http://qs321.pair.com?node_id=251903


in reply to Re: Re: strange error when subclassing packages
in thread problem using Class::Factory

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.
dragonchild