[PATCH] perlcommunity.pod: add information about OSDC.fr
[p5sagit/p5-mst-13.2.git] / pod / perlfunc.pod
index fd8aa88..c440faa 100644 (file)
@@ -4331,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