I think this will do what you want:
@sorted = sort { $hashed{$a} <=> $hashed{$b} || $a cmp $b } keys %hashed;
The string comparison on keys only happens when the hash's values are equal, because of the short-circuit behavior of ||.
After Compline,
Zaxo
In reply to Re: Hash sort with equal values
by Zaxo
in thread Hash sort with equal values
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |