Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^5: A Scalar::Util::refaddr Oddity

by adrianh (Chancellor)
on Sep 26, 2005 at 12:49 UTC ( [id://495089]=note: print w/replies, xml ) Need Help??


in reply to Re^4: A Scalar::Util::refaddr Oddity
in thread A Scalar::Util::refaddr Oddity

Wouldn't blessing a copy of the reference in order to extract the address work, and allow the blessed copy to be discarded leaving the original unmodified?

Nope. Blessedness is associated with the referent not the reference. For example:

use Test::More 'no_plan'; my $original = bless {}, 'Something'; isa_ok $original, 'Something'; my $copy = $original; bless $copy, 'SomethingElse'; isa_ok $original, 'SomethingElse'; __END__ ok 1 - The object isa Something ok 2 - The object isa SomethingElse 1..2

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-20 05:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found