my @cols; for my $row (@array) { my @f = split /,/, $row; push @{$cols[$_]}, $f[$_] for 0 .. $#f; }