in reply to Numerical sorting issues with a hash of hashes

You're using sort in a null context.

Sort doesn't permanently change the order of something, it just gives you back a sorted copy. In your original code, the first sort gets used by the foreach, but nothing happens to the results of the second sort, it's just thrown away (aka "null context").

Assuming you just want to print the contents of the inner hashes in numeric key order, try something like the following:

foreach my $key ( keys %event_hash ) { print "$key: { "; foreach my $key2 ( sort { $a <=> $b } keys %{ $event_hash{$key} } ) +{ print "$key2=$event_hash{$key}{$key2} "; } print "}\n"; }