in reply to Re^3: 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?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

Replies are listed 'Best First'.
Re^5: A Scalar::Util::refaddr Oddity
by adrianh (Chancellor) on Sep 26, 2005 at 12:49 UTC
    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