in reply to What is the best way to compare variables so that different types are non-equal?
eq is supposed to "ignore types" it's just comparing the stringified arguments
eq: Binary "eq" returns true if the left argument is stringwise equal to the right argument.
so two arguments mapped to the same string are "equal".
I think you want something like === in JS¹, IMHO you have to construct this on your own.
Cheers Rolf
UPDATE: repaired broken link to [doc://eq]
(¹) an approach with operator overloading can be found here:
Re: What is the best way to compare variables so that different types are non-equal? (overloading "cmp")
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: What is the best way to compare variables so that different types are non-equal?
by LanX (Saint) on Jul 19, 2009 at 21:06 UTC | |
by ELISHEVA (Prior) on Jul 19, 2009 at 23:59 UTC |
In Section
Seekers of Perl Wisdom