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
|
|---|