From: Roderick Schertler <roderick@gate.net>
Date: Thu, 9 Jan 1997 04:45:58 +0000 (-0500)
Subject: Re: FileCache::cacheout clobbers $_
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7adad424447c8a24bce71f2593459be2ef4eb957;p=p5sagit%2Fp5-mst-13.2.git

Re: FileCache::cacheout clobbers $_

This bug report was from last July, but the bug is still there.
FileCache.pm and cacheout.pl clobber $_.

p5p-msgid: <pz3ewb3189.fsf@eeyore.ibcinc.com>
---

diff --git a/lib/FileCache.pm b/lib/FileCache.pm
index 3d01371..4fd6331 100644
--- a/lib/FileCache.pm
+++ b/lib/FileCache.pm
@@ -53,7 +53,7 @@ sub cacheout {
     ($file) = @_;
     unless (defined $cacheout_maxopen) {
 	if (open(PARAM,'/usr/include/sys/param.h')) {
-	    local $.;
+	    local ($_, $.);
 	    while (<PARAM>) {
 		$cacheout_maxopen = $1 - 4
 		    if /^\s*#\s*define\s+NOFILE\s+(\d+)/;
diff --git a/lib/cacheout.pl b/lib/cacheout.pl
index 48d594b..64378cf 100644
--- a/lib/cacheout.pl
+++ b/lib/cacheout.pl
@@ -35,7 +35,7 @@ $seq = 0;
 $numopen = 0;
 
 if (open(PARAM,'/usr/include/sys/param.h')) {
-    local($.);
+    local($_, $.);
     while (<PARAM>) {
 	$maxopen = $1 - 4 if /^\s*#\s*define\s+NOFILE\s+(\d+)/;
     }