foreach $row (@array) { foreach $column (ref $row ? @$row : $row) { print "This is the \$column: ".$column."\n"; } }