in reply to Twice the pleasure of sorting a hash

try this:

foreach (sort { ($saved_key{$b} <=> $saved_key{$a}) || ($a cmp $b) } keys %saved_key)

That sorts the hash by values (numerically), and then by keys (alphabetically)
  • Comment on Re: Twice the pleasure of sorting a hash