NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
UNIVERSAL::isa (Score:4, Interesting)
#!perl -l
$x = {};
print UNIVERSAL::isa($x,"Foo::Bar") ? 1 : 0;
print UNIVERSAL::isa($x,"HASH") ? 1 : 0;
__END__
0
1
(as documented in the UNIVERSAL manpage)
Re:UNIVERSAL::isa (Score:2, Interesting)
Re:UNIVERSAL::isa (Score:3, Interesting)
Re:UNIVERSAL::isa (Score:1)
Re:UNIVERSAL::isa (Score:2)
Re:UNIVERSAL::isa (Score:1)
Essentially it alters S_refto in pp.c. magicrefs.pm sets a hint that is examined in S_refto to determine whether or not we should bless all references that are created (with the exception of those that are SvREADONLY). magicrefs also use's the various reftype modules.
Reply to This
Parent
Re:UNIVERSAL::isa (Score:2)
Re:UNIVERSAL::isa (Score:1)
You could probably do this by overloading the dereferencing operators.
Obviously, at the expend of acceptable performance.