This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In the debugger use local $ENV{MANPATH}, instead of a work around.
authorNicholas Clark <nick@ccl4.org>
Sat, 25 May 2013 09:53:46 +0000 (11:53 +0200)
committerNicholas Clark <nick@ccl4.org>
Sat, 25 May 2013 09:53:46 +0000 (11:53 +0200)
local on regular hashes was fixed to delete elements it added by commit
1f5346dc23a1f0ea in Dec 2000. The analogous fix for tied hashes was made by
commit c39e6ab0a7545b7a in May 2002. So the work around can go.

lib/perl5db.pl

index 33d361e..0705341 100644 (file)
@@ -8916,8 +8916,7 @@ sub runman {
     chop $manpath if $manpath;
 
     # harmless if missing, I figure
-    my $oldpath = $ENV{MANPATH};
-    $ENV{MANPATH} = $manpath if $manpath;
+    local $ENV{MANPATH} = $manpath if $manpath;
     my $nopathopt = $^O =~ /dunno what goes here/;
     if (
         CORE::system(
@@ -8951,12 +8950,6 @@ sub runman {
             }
         }
     } ## end if (CORE::system($doccmd...
-    if ( defined $oldpath ) {
-        $ENV{MANPATH} = $manpath;
-    }
-    else {
-        delete $ENV{MANPATH};
-    }
 } ## end sub runman
 
 #use Carp;                          # This did break, left for debugging