my @AoA; while () { my @row = split; push @{$AoA[$_]}, $row[$_] for 0..$#row; }