summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-10-13 02:06:09 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-10-13 02:06:09 +0000
commit155fc61f8f24f48a8180aab9a504f33842272586 (patch)
treee47859a05a977e799beedf4df31ce98c05580a63 /t
parent9d080a6634fd73a615f3f2bc087428102f6a5c3e (diff)
downloadperl-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')
-rwxr-xr-xt/op/eval.t27
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++;