Note that depending on what you consider to be alphabetical order, you may need to use locale; and tweak that pragma's settings to get cmp to do what you want. See perlop and perllocale. The idea is that "ABCDEabcde", "AaBbCcDdEe", "aAbBcCdDeE", among others can all be valid sorting outcomes, but unless you specify, you may get an order you're not wanting.
Dave
In reply to Re: Sort hash by key length and alphabetically
by davido
in thread Sort hash by key length and alphabetically
by perlcat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |