RT #1229: Exporter pod
-
Basics
- Id
- 1229
- Status
- resolved
-
Dates
- Created:
- 1999-08-18 06:41:12
- Author:
- Anno Siegel
- Last Updated:
- 2001-03-28 04:23:40
- Closed:
-
Custom Fields
- Fixed In:
- Operating System:
- Linux
- PatchStatus:
- Perl Version:
- 5.005_03
- Severity:
- medium
- Type:
- utilities
-
Links
- DependedOnBy:
- DependsOn:
- MemberOf:
- Members:
- ReferredToBy:
- RefersTo:
-
People
- Owner:
- Nobody in particular <>
- Requestors:
- Anno Siegel <anno...@lub...>
- Cc:
- AdminCC:
# Anno Siegel <anno...@lub...>
Tue, 17 Aug 1999 23:41:12 -0700
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.
Anno
*** 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.
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
Platform:
osname=linux, osvers=2.0.36, archname=i586-linux
uname='linux lublin.zrz.tu-berlin.de 2.0.36 #5 fre apr 23 14:43:16 cest 1999 i586 unknown '
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
Compiler:
cc='cc', optimize='-O2', gccversion=2.7.2.3
cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
libc=, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Locally applied patches:
---
@INC for perl 5.00503:
/usr/lib/perl5/5.00503/i586-linux
/usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/i586-linux
/usr/lib/perl5/site_perl/5.005
.
---
Environment for perl 5.00503:
HOME=/opt/home/anno4000
LANG=de
LANGUAGE (unset)
LC_ALL=de_DE
LD_LIBRARY_PATH=/usr/X11R6/lib:/usr/local/LessTif/Motif1.2/lib
LOGDIR (unset)
PATH=/opt/home/anno4000/bin:/sbin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/openwin/bin:/usr/games
PERL_BADLANG (unset)
SHELL=/bin/tcsh