in reply to How can I sort this data on the first field
my %sort = map{ /^(\d+)\|(\w+)/ and $1, $2 } <DATA>; print "$_ - $sort{$_} \n" for sort keys %sort; [download]