From: Gurusamy Sarathy Date: Fri, 28 Jan 2000 17:10:08 +0000 (+0000) Subject: avoid leaking lexicals into program being debugged (from Ilya X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=23a291ecc0b0db5b0b70703bcb8d2e61c4ca6fb5;p=p5sagit%2Fp5-mst-13.2.git avoid leaking lexicals into program being debugged (from Ilya Zakharevich) p4raw-id: //depot/perl@4923 --- diff --git a/lib/perl5db.pl b/lib/perl5db.pl index d2bd98e..b463dec 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;