note
james28909
Using Hash of Arrays, is simple enough.
<code>
use strict;
use warnings;
my %hash;
while (<DATA> =~ /(\d)\s+(\d)\s+(\d)\s+(\w+)/){
push @{$hash{$4}}, $1, $2, $3;
}
print "@{$hash{$_}}[0..2] $_\n" for sort keys %hash;
__DATA__
1 2 3 delta
1 2 3 apricot
1 2 3 charlie
1 2 3 bravo
1 2 3 echo
1 2 3 fox
</code>
EDIT: changed up code slightly
11101345
11101345