X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlfunc.pod;h=c440faa4100163019f5b91e9c5cbea6d0077be1e;hb=4ff31b786b9f6148fc8ea695db081861576d06a2;hp=fd8aa886692aadc15accd30d5fe9213ec2ce982a;hpb=6fa4d285bff5644bebb95aff09143322042282cc;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index fd8aa88..c440faa 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -4331,6 +4331,15 @@ C 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 in a C 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