summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-01-28 17:10:08 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-01-28 17:10:08 +0000
commit23a291ecc0b0db5b0b70703bcb8d2e61c4ca6fb5 (patch)
tree2ff93ba60afbc2c79103905053938898c72026a2
parented09ebcd233be9c9ff535eb632b2f11760c24bca (diff)
downloadperl-23a291ecc0b0db5b0b70703bcb8d2e61c4ca6fb5.tar.gz
avoid leaking lexicals into program being debugged (from Ilya
Zakharevich) p4raw-id: //depot/perl@4923
-rw-r--r--lib/perl5db.pl8
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;