use base qw(xxx); is equivalent to require xxx; our @ISA=qw(xxx);. Since base requires the module and doesn't use it, the base module's import method is never called. Therefore, no symbols are imported from the base class to the deriving class's namespace.
If I recall correctly, perl only follows derivation chains to locate a sub to satisfy object methods. If you were using __PACKAGE__->whatever(), perl would not look for whatever() in base classes since that syntax specifies a class method, not an object method. Perl would only look for it in the current package. Since the base module was required and not used, no import was performed and the symbol doesn't exist in the current module.
When you remove the use base and replace it with use followed by setting @ISA yourself, the fact that you've used the module gets the routine into your packages namespace and everything works.
|90% of every Perl application is already written. ⇒|
|Replies are listed 'Best First'.|
Re^4: strange error when subclassing packages
by adrianh (Chancellor) on Apr 21, 2003 at 09:33 UTC
Re^4: strange error when subclassing packages (not use vs require)
by Aristotle (Chancellor) on Apr 21, 2003 at 02:50 UTC
by pfaut (Priest) on Apr 21, 2003 at 12:50 UTC