http://qs321.pair.com?node_id=700585


in reply to Re^2: Sort log file alphabetically
in thread Sort log file alphabetically

You don't have to worry about the data staying with the identifier since that association is saved in the hash for the line.

Re-formatting the lines is just looping over @list:

my @keys = ...order you want the named keys in... for my $h (@list) { print join(",", $h->{first}, $h->{date}, map { $_." ".$h->{$_} } @keys), "\n"; }