my @array = ( [ 1..3 ], [ 2..6 ] ); for my $i (0 .. $#array) { for $k (0..$#{ $array[$i] }) { ## This is the key. print $array[$i][$k]; } }