Keep It Simple, Stupid | |
PerlMonks |
Re^3: Need advice on checking two hashes values and keysby aaron_baugher (Curate) |
on Jun 03, 2015 at 23:29 UTC ( [id://1129015]=note: print w/replies, xml ) | Need Help?? |
You're welcome. One way of doing it with a hash of arrays while maintaining the original order would be to save the line number in which you find each key together with its value. So your hash after the first loop would look like this:
Then after the second loop it would look like this:
Then you'd need to learn how to sort the hash on the first element in each sub-array so that you can print them out in order. If you want to try that, then inside your first loop, you can get the line number to go with each key/value pair from the special $. variable. Aaron B.
In Section
Seekers of Perl Wisdom
|
|