summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-10-13 03:15:50 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-10-13 03:15:50 +0000
commit6b35e00972a13cc3d5e641e82fd498a9d9f6a324 (patch)
tree3e809e40b478caf5f1a1d7f844fef4f2229189fc /t
parent155fc61f8f24f48a8180aab9a504f33842272586 (diff)
downloadperl-6b35e00972a13cc3d5e641e82fd498a9d9f6a324.tar.gz
change#1614 merely disabled earlier fix (doh!); undo it and properly
fixup the cop_seq value that must be seen by lexical lookups that emanate within eval'' p4raw-link: @1614 on //depot/perl: bd28dd3ca083953e5682058b02b9529902e14ca9 p4raw-id: //depot/perl@1944
Diffstat (limited to 't')
-rwxr-xr-xt/op/eval.t17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/op/eval.t b/t/op/eval.t
index efa189e2a3..5a9c1981b9 100755
--- a/t/op/eval.t
+++ b/t/op/eval.t
@@ -100,3 +100,20 @@ do_eval('eval q[print "ok $x\n"]');
$x++;
do_eval('sub { eval q[print "ok $x\n"] }->()');
$x++;
+
+# can recursive subroutine-call inside eval'' see its own lexicals?
+sub recurse {
+ my $l = shift;
+ if ($l < $x) {
+ ++$l;
+ eval 'print "# level $l\n"; recurse($l);';
+ die if $@;
+ }
+ else {
+ print "ok $l\n";
+ }
+}
+{
+ local $SIG{__WARN__} = sub { die "not ok $x\n" if $_[0] =~ /^Deep recurs/ };
+ recurse($x-5);
+}