Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: my least favorite perl feature

by adrianh (Chancellor)
on Feb 06, 2003 at 20:21 UTC ( [id://233257]=note: print w/replies, xml ) Need Help??


in reply to Re^3: my least favorite perl feature
in thread my least favorite perl feature

Overloading == is the problem with that I'm afraid :-)

Replies are listed 'Best First'.
Re^5: my least favorite perl feature
by diotalevi (Canon) on Feb 06, 2003 at 20:46 UTC

    I'll admit ignorance of overloading but wouldn't only apply if you went $obj_var_a == $obj_var_b? The snippet I showed took references to both and compared the address on the references. Wouldn't that bypass any == overloading because the newly created references aren't overloaded?


    Seeking Green geeks in Minnesota

      Remember: it's the referant, not the reference that's blessed - so taking a reference to $obj_var_a can give you an object that overloads ==. Consider:

      my $obj_var_a = 42; my $o = bless \$obj_var_a, 'OverloadedClass'; my $ref = \$obj_var_a; print "overloaded" if $ref->isa('OverloadedClass');

      Don't you just love exceptions like this :-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-23 06:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found