The documentation of Exporter is missing an explicit statement about
what can go into the @EXPORT and @EXPORT_OK arrays. Because of the
optional &-prefix for functions the rule is not obvilous and since
many modules export only (prefix-less) functions, the examples users
are likely to find may be misleading. This was discussed on clpm
under the subject "<== importing hash symbols from one package".
See patch below.
*** Exporter.pm Tue Aug 17 12:43:08 1999
--- Exporter.pm.mod Wed Aug 18 12:26:52 1999
*** 285,290 ****
--- 285,302 ----
modules and how the C<use> statement operates is important to
understanding the Exporter.
+ =head2 How to Export
+ The arrays C<@EXPORT> and C<@EXPORT_OK> in a module hold lists of
+ symbols that are going to be exported into the users name space by
+ default, or which they can request to be exported, respectively. The
+ symbols can represent functions, scalars, arrays, hashes, or typeglobs.
+ The symbols must be given by full name with the exception that the
+ ampersand in front of a function is optional, e.g.
+ @EXPORT = qw(sub $scalar @array); # sub is a function
+ @EXPORT_OK = qw(&func %hash *typeglob); # explicit prefix on &func
=head2 Selecting What To Export
Do B<not> export method names!
Site configuration information for perl 5.00503:
Configured by anno4000 at Tue Jun 22 10:49:57 MEST 1999.