in reply to Sort hash by key length and alphabetically
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
|
|---|