in reply to Sorting a hash of a hash using anonymous subs
Hashes are by their very nature unsorted. Calling each, keys, or values on a vanilla hash isn't going to return things in any sort of sorted order. Your sorter does nothing useful as any ordering is lost when you insert things into the new hash.
What you really need to do is sort a list of the keys using one of your coderefs, then use that to iterate over the contents.
|
|---|