From: Michael De La Rue Date: Sat, 7 Sep 1996 19:37:44 +0000 (+0200) Subject: File::Find assumes $_ remains unchanged; bug X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=47a735e8c1e6b0fa532abd5b711f042582ae8c0c;p=p5sagit%2Fp5-mst-13.2.git File::Find assumes $_ remains unchanged; bug The File::Find perl module assumes that the $_ variable remains unchanged through the user defined function which is callbacked from find. It carries out a stat operation Simplest fix is merely to document this --- diff --git a/lib/File/Find.pm b/lib/File/Find.pm index 03ace14..b0312be 100644 --- a/lib/File/Find.pm +++ b/lib/File/Find.pm @@ -31,6 +31,9 @@ C<"$File::Find::dir/$_">. You are chdir()'d to $File::Find::dir when the function is called. The function may set $File::Find::prune to prune the tree. +File::Find assumes that you don't alter the $_ variable. If you do then +make sure you return it to its original value before exiting your function. + This library is primarily for the C tool, which when fed, find2perl / -name .nfs\* -mtime +7 \