in reply to Enumerate an array of arrays?

A few other ways of accessing your rows and elements are:

use strict; use warnings; my @list=(["1","2","3"],["a","b","c"]); print "A row:\n"; for my $element (@{$list[0]}) { print "$element\n"; } print "or stringify row: @{$list[0]}\n\n"; print "All rows:\n"; for my $row (@list) { print "@$row\n"; } print "\nAll rows by index:\n"; for my $rowIndex (0 .. $#list) { print "row $rowIndex: @{$list[$rowIndex]}\n"; }

Prints:

A row: 1 2 3 or stringify row: 1 2 3 All rows: 1 2 3 a b c All rows by index: row 0: 1 2 3 row 1: a b c

Perl is environmentally friendly - it saves trees