diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-10-13 02:06:09 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-10-13 02:06:09 +0000 |
commit | 155fc61f8f24f48a8180aab9a504f33842272586 (patch) | |
tree | e47859a05a977e799beedf4df31ce98c05580a63 /t/op/eval.t | |
parent | 9d080a6634fd73a615f3f2bc087428102f6a5c3e (diff) | |
download | perl-155fc61f8f24f48a8180aab9a504f33842272586.tar.gz |
ensure recursive attempts to findlex()icals know enough about where
the last eval'' context was encountered
p4raw-id: //depot/perl@1943
Diffstat (limited to 't/op/eval.t')
-rwxr-xr-x | t/op/eval.t | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/t/op/eval.t b/t/op/eval.t index 9368281d5b..efa189e2a3 100755 --- a/t/op/eval.t +++ b/t/op/eval.t @@ -1,8 +1,6 @@ #!./perl -# $RCSfile: eval.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:48 $ - -print "1..23\n"; +print "1..27\n"; eval 'print "ok 1\n";'; @@ -79,3 +77,26 @@ eval { }; &$x(); } + +my $b = 'wrong'; +my $X = sub { + my $b = "right"; + print eval('"$b"') eq $b ? "ok 24\n" : "not ok 24\n"; +}; +&$X(); + + +# check navigation of multiple eval boundaries to find lexicals + +my $x = 25; +eval <<'EOT'; die if $@; + sub do_eval { + eval $_[0]; die if $@; + } +EOT +do_eval('print "ok $x\n"'); +$x++; +do_eval('eval q[print "ok $x\n"]'); +$x++; +do_eval('sub { eval q[print "ok $x\n"] }->()'); +$x++; |