my %myHash = ("A" => 215, "B"=> 10, "C" => 345, "D" => 30, "E"=>150); foreach my $key (sort { $myHash{$b} <=> $myHash{$a}} keys %myHash){ print "$key - $myHash{$key}\n"; }