develooper Front page | perl.perl5.porters | Postings from March 2000

Re: [ID 20000315.014] possible bug in perlmod

Thread Previous
Ronald J Kimball
March 15, 2000 10:17
Re: [ID 20000315.014] possible bug in perlmod
Message ID:
On Wed, Mar 15, 2000 at 01:10:02PM -0500, Susan Kleinmann wrote:
> There are two declarations of @EXPORT_OK in the perlmod man page:
>   one within the BEGIN block:
> and 
>   one just outside it:
>      use vars @EXPORT_OK;
> If the latter is not just redundant, it would be very useful to point out
> its purpose.

The latter is not a declaration of @EXPORT_OK.  It is a declaration of the
variables named in @EXPORT_OK.

           BEGIN {
               use Exporter   ();
               use vars       qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);


               # your exported package globals go here,
               # as well as any optionally exported functions
               @EXPORT_OK   = qw($Var1 %Hashit &func3);
           use vars      @EXPORT_OK;

So, that line is effectively:

use vars qw($Var1 %Hashit &func3);


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About