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

Re: [ID 20000315.014] possible bug in perlmod

Thread Previous
From:
Ronald J Kimball
Date:
March 15, 2000 10:17
Subject:
Re: [ID 20000315.014] possible bug in perlmod
Message ID:
20000315131348.C21019@linguist.dartmouth.edu
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:
>      use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
> 
> 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);


Ronald

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About