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