Change 26128: A better fix for [perl #35847] File::Find not performing as documented,

[email protected] (Rafael Garcia-Suarez) Mon, 14 Nov 2005 08:12:35 -0800
Newsgroups perl.perlfaq.workers,perl.perl5.changes
Message-ID <[email protected]>
Change 26128 by rgs@bloom on 2005/11/14 15:40:08

	A better fix for [perl #35847] File::Find not performing as documented,
	suggested by Darren Dunham. Includes a fix to the code example that
	uses File::Find in perlfaq3.

Affected files ...

... //depot/perl/lib/File/Find.pm#83 edit
... //depot/perl/pod/perlfaq3.pod#89 edit

Differences ...

==== //depot/perl/lib/File/Find.pm#83 (text) ====
Index: perl/lib/File/Find.pm
--- perl/lib/File/Find.pm#82~26076~	Thu Nov 10 06:26:12 2005
+++ perl/lib/File/Find.pm	Mon Nov 14 07:40:08 2005
@@ -120,11 +120,10 @@
 
 =item *
 
-Previous versions of File::Find were guaranteed to call an I<lstat>
-before the user's C<wanted()> function was called, but this is no
-longer the case.  Since this depends on C<$File::Find::dont_use_nlink>, $^O,
-and other factors, fast file checks involving C<_> are not recommended
-unless C<wanted()> calls I<lstat> first.
+It is guaranteed that an I<lstat> has been called before the user's
+C<wanted()> function is called. This enables fast file checks involving S<_>.
+Note that this guarantee no longer holds if I<follow> or I<follow_fast>
+are not set.
 
 =item *
 

==== //depot/perl/pod/perlfaq3.pod#89 (text) ====
Index: perl/pod/perlfaq3.pod
--- perl/pod/perlfaq3.pod#88~25857~	Wed Oct 26 05:52:37 2005
+++ perl/pod/perlfaq3.pod	Mon Nov 14 07:40:08 2005
@@ -85,10 +85,12 @@
     use File::Find;
     my @files;
 
-    find sub { push @files, $File::Find::name if -f _ && /\.pm$/ },
-         @INC;
+    find(
+      sub { push @files, $File::Find::name if -f $File::Find::name && /\.pm$/ },
+      @INC
+    );
 
-	print join "\n", @files;
+    print "$_\n" for @files;
 
 If you simply need to quickly check to see if a module is
 available, you can check for its documentation.  If you can
End of Patch.