From: Steve Peters Date: Mon, 24 Apr 2006 16:29:59 +0000 (+0000) Subject: Reverting change #27953, as it appears that File::Find has X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4c767a4e3c47151a49dd94c9e1c1cd4816054600;p=p5sagit%2Fp5-mst-13.2.git Reverting change #27953, as it appears that File::Find has localized the C<$_> usable by the wanted function since version 1.04 (change #18501, to be exact). Update the docs to express this change. Finally, bump the version. p4raw-link: @27953 on //depot/perl: 668a78bfe3bf9a6d16f5b059341fb64b1e120158 p4raw-link: @18501 on //depot/perl: 17ab9c147afa44f9f620bca432b3948e42711043 p4raw-id: //depot/perl@27954 --- diff --git a/lib/File/Find.pm b/lib/File/Find.pm index 9c81c6a..1f80f06 100644 --- a/lib/File/Find.pm +++ b/lib/File/Find.pm @@ -215,6 +215,9 @@ through a collection of variables. =back +The above variables have all been localized and may be changed without +effecting data outside of the wanted function. + For example, when examining the file F you will have: $File::Find::dir = /some/path/ @@ -237,18 +240,6 @@ table below summarizes all variants: /etc / /etc /etc/x /etc /etc/x -Do not modify these variables. If you want to use C<$_>, it must -be restored to its initial value before returning from the -function. C may be used for this purpose: - - sub callback { - open my $fh, '<', $_ or die "Cannot open $_ for input: $!\n"; - local $_; # localize $_ for the remainder of the routine - while (<$fh>) { - # manipulate $_ - } - # $_ will be restored upon leaving - } When or are in effect, there is also a C<$File::Find::fullname>. The function may set