my @sorted_keys = sort { $hash{ $b } <=> $hash{ $a } } keys %hash; for my $key ( @sorted_keys ) { print "$key -> $hash{$key}\n"; }