summaryrefslogtreecommitdiff
path: root/t/op/misc.t
diff options
context:
space:
mode:
Diffstat (limited to 't/op/misc.t')
-rwxr-xr-xt/op/misc.t10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/op/misc.t b/t/op/misc.t
index 881f99dc18..679dd91d0d 100755
--- a/t/op/misc.t
+++ b/t/op/misc.t
@@ -599,6 +599,16 @@ EOT
EXPECT
ok
########
+# test that closures generated by eval"" hold on to the CV of the eval""
+# for their entire lifetime
+$code = eval q[
+ sub { eval '$x = "ok 1\n"'; }
+];
+&{$code}();
+print $x;
+EXPECT
+ok 1
+########
# This test is here instead of pragma/locale.t because
# the bug depends on in the internal state of the locale
# settings and pragma/locale messes up that state pretty badly.