in reply to Re: Re: Re: Array of arrays
in thread Array of arrays
my $first = @{$ref_to_array}[0]; # prefix
That should be:
my $first = ${$ref_to_array}[0]; # prefix
Just like with a regular array, you should use $ when accessing a single element, and save @ for when you want a slice.
To finish the abbreviation:# the easy way $LoL[0]->[0]->[1] = 'It's a bird, it's a plane, it's...'; # the shortcut $LoL[0]->[0][2] = 'Superman!';
# the full shortcut $LoL[0][0][2] = 'Superman!';
|
|---|