There have already been lots of good answers, but since i had already thrown this together, here it is for whatever value it might be. Cheers.
sub process_file {
my ($hash, $file) = @_;
open my $fh, "<", $file or die $!;
while (<$fh>) {
chomp;
my ($target, @columns) = split /,/;
$hash->{$target}[0] = $target;
for my $c (0 .. $#columns) {
$hash->{$target}[$c+1] .= $columns[$c];
}
}
close $fh;
}
$, = ',';
print ("Now merging \n");
my $data = {};
process_file($data, $_) for glob("*.csv");
say @{$data->{$_}} for sort keys %$data;