diff options
author | Dan Book <grinnz@grinnz.com> | 2019-03-07 19:34:14 -0500 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2019-04-15 10:37:21 +1000 |
commit | b634e872a7ee3248af35af6fd99e8e2beff2060a (patch) | |
tree | 4b02d11071f78981e98e803ea7943634a23895dd /pod/perlmod.pod | |
parent | 3625d2a87d165ed801ba5ca7e0194e88aed15df9 (diff) | |
download | perl-b634e872a7ee3248af35af6fd99e8e2beff2060a.tar.gz |
modernize Exporter usage in perlmod module template
TonyC: placate podcheck by wrapping a verbatim line.
Diffstat (limited to 'pod/perlmod.pod')
-rw-r--r-- | pod/perlmod.pod | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/pod/perlmod.pod b/pod/perlmod.pod index c87a68d837..fdfb3811e5 100644 --- a/pod/perlmod.pod +++ b/pod/perlmod.pod @@ -447,21 +447,18 @@ create a file called F<Some/Module.pm> and start with this template: use strict; use warnings; - BEGIN { - require Exporter; + # Get the import method from Exporter to export functions and + # variables + use Exporter 5.57 'import'; - # set the version for version checking - our $VERSION = 1.00; + # set the version for version checking + our $VERSION = '1.00'; - # Inherit from Exporter to export functions and variables - our @ISA = qw(Exporter); + # Functions and variables which are exported by default + our @EXPORT = qw(func1 func2); - # Functions and variables which are exported by default - our @EXPORT = qw(func1 func2); - - # Functions and variables which can be optionally exported - our @EXPORT_OK = qw($Var1 %Hashit func3); - } + # Functions and variables which can be optionally exported + our @EXPORT_OK = qw($Var1 %Hashit func3); # exported package globals go here our $Var1 = ''; @@ -487,7 +484,7 @@ create a file called F<Some/Module.pm> and start with this template: sub func1 { ... } sub func2 { ... } - # this one isn't exported, but could be called directly + # this one isn't always exported, but could be called directly # as Some::Module::func3() sub func3 { ... } |