This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
use semicolon to separate statements
[perl5.git] / lib / subs.pm
index 512bc9b..2481459 100644 (file)
@@ -1,8 +1,10 @@
 package subs;
 
+our $VERSION = '1.03';
+
 =head1 NAME
 
-subs - Perl pragma to predeclare sub names
+subs - Perl pragma to predeclare subroutine names
 
 =head1 SYNOPSIS
 
@@ -11,16 +13,17 @@ subs - Perl pragma to predeclare sub names
 
 =head1 DESCRIPTION
 
-This will predeclare all the subroutine whose names are 
-in the list, allowing you to use them without parentheses
+This will predeclare all the subroutines whose names are
+in the list, allowing you to use them without parentheses (as list operators)
 even before they're declared.
 
 Unlike pragmas that affect the C<$^H> hints variable, the C<use vars> and
-C<use subs> declarations are not BLOCK-scoped.  They are thus effective
-for the entire file in which they appear.  You may not rescind such
+C<use subs> declarations are not lexically scoped to the block they appear
+in: they affect
+the entire package in which they appear.  It is not possible to rescind these
 declarations with C<no vars> or C<no subs>.
 
-See L<perlmod/Pragmatic Modules> and L<strict/strict subs>.
+See L<perlmodlib/Pragmatic Modules> and L<strict/strict subs>.
 
 =cut
 
@@ -30,7 +33,7 @@ sub import {
     my $callpack = caller;
     my $pack = shift;
     my @imports = @_;
-    foreach $sym (@imports) {
+    foreach my $sym (@imports) {
        *{"${callpack}::$sym"} = \&{"${callpack}::$sym"};
     }
 };