単純なピボットがしたかった。
use Text::CSV::Simple;
my $file = shift;
my $parser = Text::CSV::Simple->new;
my @list = qw/cl1 cl2 cl3 cl4 cl5/;
$parser->field_map(@list);
my @data = $parser->read_file($file);
my $pivdata = {};
for my $d (@data){
for my $label (@list){
push @{$pivdata->{$label}},$d->{$label};
}
}
for my $label (@list){
print join ",", @{$pivdata->{$label}};
print "\n";
}