foreach my $key ( sort { $word_list{$b} <=> $word_list{$a} } keys %word_list ) { print $key, " ", $word_list{$key}, "\n"; }