Re: MIDI::Score

[email protected] ("Sean M. Burke") Thu, 22 May 2003 04:54:14 -0800
Newsgroups perl.midi
Message-ID <[email protected]>
At 10:01 PM 2003-05-19 +0000, Dave Turner wrote:
>  my $event_r = \@opus;

I think you want instead something like:

my @tracks = $opus->tracks;
die "What, no tracks?" unless @tracks;
my $event_r = $tracks[0]->$track->events_r
  || die "No events in there?!";

Or, without all the checking:
my $event_r = ( $opus->tracks )[0]->events_r;

Or even:
my $event_r = $opus->tracks_r->[0]->events_r;


And don't forget "use strict;" !

--
Sean M. Burke    http://search.cpan.org/~sburke/