We don't bite newbies here... much | |
PerlMonks |
Re: Equality operatorsby rhesa (Vicar) |
on Apr 26, 2006 at 11:37 UTC ( [id://545768]=note: print w/replies, xml ) | Need Help?? |
Just to confuse matters a bit, because Perl lets me:
Using overload could result in similarly confusing comparisons. This isn't as contrived as it sounds:
URI defines an overload for stringification, but not for numification. In numerical context, objects evaluate to their location in memory. And the two different objects are stored in different locations, so == returns false. So be careful with == and eq :)
In Section
Seekers of Perl Wisdom
|
|