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