diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-28 17:10:08 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-28 17:10:08 +0000 |
commit | 23a291ecc0b0db5b0b70703bcb8d2e61c4ca6fb5 (patch) | |
tree | 2ff93ba60afbc2c79103905053938898c72026a2 | |
parent | ed09ebcd233be9c9ff535eb632b2f11760c24bca (diff) | |
download | perl-23a291ecc0b0db5b0b70703bcb8d2e61c4ca6fb5.tar.gz |
avoid leaking lexicals into program being debugged (from Ilya
Zakharevich)
p4raw-id: //depot/perl@4923
-rw-r--r-- | lib/perl5db.pl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/perl5db.pl b/lib/perl5db.pl index d2bd98e654..b463decf20 100644 --- a/lib/perl5db.pl +++ b/lib/perl5db.pl @@ -1254,11 +1254,11 @@ sub save { # The following takes its argument via $evalarg to preserve current @_ sub eval { - my @res; + local @res; # 'my' would make it visible from user code { - my $otrace = $trace; - my $osingle = $single; - my $od = $^D; + local $otrace = $trace; + local $osingle = $single; + local $od = $^D; @res = eval "$usercontext $evalarg;\n"; # '\n' for nice recursive debug $trace = $otrace; $single = $osingle; |