in reply to How to swap rows with columns?
Assuming the same number of fields on every row of the data file,
my @data; while (<>) { my @fields = split ' '; for my $row (0..$#fields) { push @{$data[$row]}, $fields[$row]; } }
Tested.
In Section
Seekers of Perl Wisdom