[PATCH] perlcommunity.pod: add information about OSDC.fr
[p5sagit/p5-mst-13.2.git] / pod / perlfunc.pod
index 2ef331a..c440faa 100644 (file)
@@ -4080,8 +4080,10 @@ Examples:
 
 The same template may generally also be used in unpack().
 
+=item package NAMESPACE VERSION
+X<package> X<module> X<namespace> X<version>
+
 =item package NAMESPACE
-X<package> X<module> X<namespace>
 
 Declares the compilation unit as being in the given namespace.  The scope
 of the package declaration is from the declaration itself through the end
@@ -4099,6 +4101,11 @@ If the package name is null, the C<main> package as assumed.  That is,
 C<$::sail> is equivalent to C<$main::sail> (as well as to C<$main'sail>,
 still seen in older code).
 
+If VERSION is provided, C<package> also sets the C<$VERSION> variable in the
+given namespace.  VERSION must be be a numeric literal or v-string; it is
+parsed exactly the same way as a VERSION argument to C<use MODULE VERSION>.
+C<$VERSION> should only be set once per package.
+
 See L<perlmod/"Packages"> for more information about packages, modules,
 and classes.  See L<perlsub> for other scoping issues.
 
@@ -4324,6 +4331,15 @@ C<chdir> there, it would have been testing the wrong file.
     @dots = grep { /^\./ && -f "$some_dir/$_" } readdir($dh);
     closedir $dh;
 
+As of Perl 5.11.2 you can use a bare C<readdir> in a C<while> loop,
+which will set C<$_> on every iteration.
+
+    opendir(my $dh, $some_dir) || die;
+    while(readdir $dh) {
+        print "$some_dir/$_\n";
+    }
+    closedir $dh;
+
 =item readline EXPR
 
 =item readline
@@ -4372,7 +4388,7 @@ C<@ARGV> yourself since C<eof> handles C<ARGV> differently.
             ...
         }
     }
-    
+
 =item readlink EXPR
 X<readlink>