The expression (%hash1 == %hash2) puts the hashes in scalar context. You're testing whether they have the same number of elements.
How strong an equality do you want to test?
To check that all elements are present and equal in each, you need to recurse through them. The &&= operator may be of help.
To check that %hash1 and %hash2 are the same object in memory, test (\%hash1 == \%hash2).
In reply to Re: How to test equality of hashes?
by Zaxo
in thread How to test equality of hashes?
by acser
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |