in reply to Sorting an array of hashes
As a peripheral note, there are several modules which allow you to keep ordered hash keys. I'm not sure if it applicable to your case, but should you want to be able to refer to entries in your data set by name and maintain order as you would in an array, this is possible with some additional overhead.
My personal choice is Tie::Hash::Indexed, as it is XS based and fast, though there are many other similar choices using tie.
If you sort entries into the hash before as you add them, keys will then continue to return this sorted order back to you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sorting an array of hashes
by madhurjf (Novice) on Sep 23, 2011 at 05:47 UTC |