in reply to Exporting forcibly and optionally, can both be done ?
The last sentence there reveals the solution. To import all the @EXPORT names and some @EXPORT_OK names, you would do something like this: use testpack qw(:DEFAULT &rtine);Specialised Import Lists If the first entry in an import list begins with !, : or / then the list is treated as a series of specifications which either add to or delete from the list of names to import. They are processed left to right. Specifications are in the form: [!]name This name only [!]:DEFAULT All names in @EXPORT [!]:tag All names in $EXPORT_TAGS{tag} anonymous li +st [!]/pattern/ All names in @EXPORT and @EXPORT_OK which m +atch A leading ! indicates that matching names should be deleted from the list of names to import. If the first specification is a deletion it is treated as though preceded by :DEFAULT. If you just want to import extra names in addition to the default set you will still need to include :DEFAULT explicitly.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Exporting forcibly and optionally, can both be done ?
by Anonymous Monk on Jun 21, 2001 at 20:28 UTC |