This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: FileCache::cacheout clobbers $_
authorRoderick Schertler <roderick@gate.net>
Thu, 9 Jan 1997 04:45:58 +0000 (23:45 -0500)
committerChip Salzenberg <chip@atlantic.net>
Wed, 15 Jan 1997 19:24:00 +0000 (07:24 +1200)
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>

lib/FileCache.pm
lib/cacheout.pl

index 3d01371..4fd6331 100644 (file)
@@ -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+)/;
index 48d594b..64378cf 100644 (file)
@@ -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+)/;
     }