in reply to Sort Hash of hashes
Hashes are unsorted by definition. The most common case is that you just want them sorted on output, in which case see for example How do I sort a hash (optionally by value instead of key)?, as well as Data::Dumper's Sortkeys option. If you really, really need to store them in a sorted order, see How can I always keep my hash sorted? (although sometimes people will solve this by simply keeping an array with the names of the keys in a sorted order, and use that to iterate over the hash)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sort Hash of hashes
by lobs (Acolyte) on Mar 22, 2016 at 22:02 UTC | |
by Marshall (Canon) on Mar 22, 2016 at 23:40 UTC |