Or you could try this version first:
#! perl -slw
use strict;
my( $id, %accu, @order );
while( <DATA> ) {
chomp;
if( m[^(\S+_\S+_\S+)\s+(.+)\s*$] ) {
$id = $1;
unless( exists $accu{ $id } ) {
push @order, $id;
$accu{ $id } = $2;
}
else {
$accu{ $id } .= ' ' . $2;
}
}
else {
my $pad = 10 - length() % 11;
$accu{ $id } .= ' ' . $_ . ' ' x $pad;
}
}
for my $key ( @order ) {
printf "%-10s %s\n", $key, substr( $accu{ $key }, 0, 55, '' );
print substr( $accu{ $key }, 0, 66, '' ) while length $accu{ $key
+};
print '';
}
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.