This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Rewrite paragraph on using strict and warnings
[perl5.git] / pod / perlmod.pod
index c87a68d..fdfb381 100644 (file)
@@ -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      { ... }