in reply to Re: Dereferencing an arrayref of arrayrefs
in thread Dereferencing an arrayref of arrayrefs
That would be better written:
for my $index (0 .. 9) { print $data[1][$index]; }
or if you want to print all the elements in the array reference you could:
for my $index (0 .. $#{$data[1]}) { print $data[1][$index]; }
or better still:
for my $element (@{$data[1]}) { print $element; }
and more succinctly as:
print $_ for @{$data[1]};
and if you would like a space between elements you can:
print "@{$data[1]}";
|
|---|