more useful options | |
PerlMonks |
Re: Clawing my way out of operator overloading hellby Elian (Parson) |
on Jul 31, 2003 at 20:52 UTC ( [id://279784]=note: print w/replies, xml ) | Need Help?? |
No overloading is required. That'll do an identity comparison of the two variables and return true if they're the exact same object. Someone probably noticed that a ref to an object (or any other thing for that matter) has a predictable string value and two references to the same thing will stringify identically.
FWIW, it's inefficient--a numeric comparison (==) is significantly faster, which can be handy to know if you're doing this comparison a lot.
In Section
Seekers of Perl Wisdom
|
|