eXile has asked for the wisdom of the Perl Monks concerning the following question:
AA.pm:use AA; AA->print("extrainfo","hi");
BB.pmpackage AA; use base 'BB'; sub AUTOLOAD { my ($self,$extrainfo,@args ) = @_; print "Via AA:\n"; print "extrainfo: $extrainfo \n"; $superfunk = "SUPER::$AUTOLOAD"; $self->$superfunk(@args); } 1;
AA.pmpackage BB; sub print { my ($self,$arg) = @_; print "I'm BB saying: $arg\n"; } 1;
if I run test.pl I'd like it to saypackage AA;
but it says:Via AA: extrainfo: extrainfo I'm BB saying: hi
I'm BB saying: extrainfo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: AUTOLOAD and inheritance
by Arunbear (Prior) on Dec 04, 2004 at 00:31 UTC | |
|
Re: AUTOLOAD and inheritance
by revdiablo (Prior) on Dec 04, 2004 at 00:21 UTC |