laziness, impatience, and hubris | |
PerlMonks |
Re: Comparing hashes without sorting the keysby Popcorn Dave (Abbot) |
on Feb 18, 2004 at 20:38 UTC ( [id://330051]=note: print w/replies, xml ) | Need Help?? |
This seems a bit of work to do strictly in Perl, but this should do what you want to do. However I do believe that davido's suggestion of the module is cleaner to work with as you're not doing the conversion of the hash to a sorted array, then to a string.
Update: As both samtregar and <a href="http://www.perlmonks.org/index.pl?node_id=56270>greenFox point out the original code blows up with the data they show in their nodes. However replacing the
with
I believe should do what I originally intended. Sorting the hash, not the array, and leaving the space in should solve the problem found by the other monks. There is no emoticon for what I'm feeling now.
In Section
Seekers of Perl Wisdom
|
|