| UNIVERSAL::isa - Attempt to recover from people calling UNIVERSAL::isa as a function |
UNIVERSAL::isa - Attempt to recover from people calling UNIVERSAL::isa as a function
# from the shell
echo 'export PERL5OPT=-MUNIVERSAL::isa' >> /etc/profile
# within your program
use UNIVERSAL::isa;
Whenever you use isa in the UNIVERSAL manpage as a function, a kitten using the Test::MockObject manpage dies. Normally, the kittens would be helpless, but if they use the UNIVERSAL::isa manpage (the module whose docs you are reading), the kittens can live long and prosper.
This module replaces UNIVERSAL::isa with a version that makes sure that,
when called as a function on objects which override isa, isa will call
the appropriate method on those objects
In all other cases, the real UNIVERSAL::isa gets called directly.
If the lexical warnings pragma is available, this module will emit a warning
for each naughty invocation of UNIVERSAL::isa. Silence these warnings by
saying:
no warnings 'UNIVERSAL::isa';
in the lexical scope of the naughty code.
the UNIVERSAL::can manpage for a more mature discussion of the problem at hand.
the Test::MockObject manpage for one example of a module that really needs to override
isa().
Autrijus Tang <autrijus@autrijus.org>
chromatic <chromatic@wgz.org>
Yuval Kogman <nothingmuch@woobling.org>
Same as Perl, (c) 2005 - 2006.
| UNIVERSAL::isa - Attempt to recover from people calling UNIVERSAL::isa as a function |