in reply to Equality checking for strings AND numbers
I posted a similar problem before, and got a great answer ( Re: check if 2 values are equal ), involving putting all things to be compared in hash as hash keys and counting the number of keys.
In Section
Seekers of Perl Wisdom