in reply to Hash error
The above monks gave you solutions to what you asked for. I'm going to speak briefly on why it doesn't work the way you are expecting.
Hashes in Perl are not meant to maintain the order in which they are built. We already have arrays for that specific reason. When you access the keys of the hash, they are returned in an order which is related to the hashing function applied to the key. When you choose to use a hash, it's assumed you are not going to want to access the entries by any means other than the keys. If you want to do so, you'll need something more complicated, like what the above monks suggest.
|
|---|