in reply to sort hash by value

Since you can't reverse a hash in the general case, you can just make a list of lists:
my @list = map { [$_, $hash{$_}] } keys %hash; # sort it: @list = sort { $a->[1] cmp $b->[1] }; # now you can print it