Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: How to test equality of hashes?by bikeNomad (Priest) |
on Jun 20, 2001 at 06:46 UTC ( [id://89899]=note: print w/replies, xml ) | Need Help?? |
Unfortunately, when you evaluate a hash in a scalar context it returns a fraction representing the hash table bucket usage, which is rarely what anyone is interested in. It doesn't even return the number of elements. If you want to compare the contents of two hashes, you'll have to look at the keys and values of both. One way to compare them:
All of this assumes that neither your keys nor values contain the $; character (by default \034)
In Section
Seekers of Perl Wisdom
|
|