http://www.perlmonks.org?node_id=1096942


in reply to How to print an array of multidimensional arrays with a for or foreach loop

for my $row (@array) { for my $col (ref($row) ? @$row : $row) { print $col, "\n"; } }

This assumes the elements at the same level as the array can't be references.