diff options
Diffstat (limited to '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++; |