Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
@ISA:
Each package contains a special array called @ISA. The @ISA array contains a list of that class's parent classes, if any. Exporter:You need to use use Exporter; in your module to get the @EXPORT array into the calling script/module, when anyone invokes a use declaration to load your module, it calls the import method from your module to fetch any symbols it needs into the package of the invoker. Your module (the one doing the exporting) can define the import method any way it pleases, but the standard way is to inherit the method from the Exporter class module. The Exporter module serves as a base class for modules that wish to establish their own exports. Oddly, object-oriented modules typically don't use Exporter, since they don't normally export anything. The import() method is invoked as a class method in your module: MyModule->import(LIST). However, since you didn't define an import method in your module, you'll automatically make use of the Exporter::import method through inheritance. All is well In reply to Re: Exporter/@ISA confusion
by vinoth.ree
|
|