http://www.perlmonks.org?node_id=749324


in reply to CSV manipulation with perl

Ignoring the problem of parsing CSV, is this what you're looking for?
#!/perl/bin/perl use Smart::Comments; use strict; use warnings; my $_raa; my $i=0; while (<DATA>) { chomp; my @a=split(','); for my $j (0..$#a) { $_raa->[$j][$i]=$a[$j] }; $i++; }; ### $_raa __DATA__ 123,"text",66,"more text" 124,"text1",67,"more text1" 125,"text2",68,"more text2"
which yields
### $_raa: [ ### [ ### '123', ### '124', ### '125' ### ], ### [ ### '"text"', ### '"text1"', ### '"text2"' ### ], ### [ ### '66', ### '67', ### '68' ### ], ### [ ### '"more text"', ### '"more text1"', ### '"more text2"' ### ] ### ]