Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Clawing my way out of operator overloading hell

by Elian (Parson)
on Jul 31, 2003 at 20:52 UTC ( [id://279784]=note: print w/replies, xml ) Need Help??


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.

  • Comment on Re: Clawing my way out of operator overloading hell

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://279784]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-25 14:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found