my @list = map { [$_, $hash{$_}] } keys %hash; # sort it: @list = sort { $a->[1] cmp $b->[1] }; # now you can print it