adichow has asked for the wisdom of the Perl Monks concerning the following question:
and Generic.pm containsuse base qw/Generic/;
Now I wish to inherit Module1 in Module2, so I say in Module2.pmrequire Exporter; our @ISA = ("Exporter"); our @EXPORT_OK = qw/sub1 sub2/;
but this gives me errors everytime I try to call a Module1 function. Do I need to include the require Exporter stuff again in Module1? Thanks. Fixed. Added the Exporter stuff in Module1 and works just fine. However, had to add ALL the subs in Module1 in its @EXPORT. Is there an easier way so that it exports all its subs by default? Thanks mate.use base qw/Module1/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Module inheritance
by dragonchild (Archbishop) on Apr 15, 2005 at 04:29 UTC | |
|
Re: Module inheritance
by QM (Parson) on Apr 15, 2005 at 21:26 UTC |