http://www.perlmonks.org?node_id=279784


in reply to Clawing my way out of operator overloading hell

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.