... sort { $h{$b} <=> $h{$a} || $a cmp $b } keys %saved_key;