in reply to sorting a hash by value with ties

Well, you can't sort a hash. Presumably you are sorting the keys of the hash?
my @ordered_keys = sort { $hash{$a} cmp $hash{$b} # by value, then || $a cmp $b # by key } keys %hash; foreach my $key (@ordered_keys) { print("$key: $hash{$key}\n"); }