in reply to @ISA, Inheritance, and Class Methods
This turns a Foo::BarMod::whiz into a Foo::BarMod->whiz -- specifically, it turns it into Wherever::whiz(Foo::BarMod, ...).use Carp; use vars '$AUTOLOAD'; # in case strict is on AUTOLOAD { my ($pkg, $func) = $AUTOLOAD =~ /(.*)::(.*)/; my $cref = $pkg->can($func) or carp "no such method $func in $pkg"; unshift @_, $pkg; goto &$cref; }
|
|---|