in reply to problem while sorting hash
You aren't creating a sorted hash. There is no such thing as a sorted hash (well, unless you use something like Tie::IxHash).
Hashes are by nature unordered. All you are doing here is adding keys to a hash. You're adding them in the correct order, but they are stored in a (seemingly) random order.
If you want things stored in a fixed order, then use an array. Not a hash.
See the Copyright notice on my home node.
"The first rule of Perl club is you do not talk about Perl club." -- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: problem while sorting hash
by Limbic~Region (Chancellor) on Mar 20, 2007 at 22:11 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |