summaryrefslogtreecommitdiff
path: root/t/op/tie.t
diff options
context:
space:
mode:
Diffstat (limited to 't/op/tie.t')
-rw-r--r--t/op/tie.t16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/op/tie.t b/t/op/tie.t
index b485f62d62..0b53b140ef 100644
--- a/t/op/tie.t
+++ b/t/op/tie.t
@@ -1014,3 +1014,19 @@ print "ok\n";
EXPECT
ok
+########
+#
+# Localising a tied COW scalar should not make it read-only.
+
+sub TIESCALAR { bless [] }
+sub FETCH { __PACKAGE__ }
+sub STORE {}
+tie $x, "";
+"$x";
+{
+ local $x;
+ $x = 3;
+}
+print "ok\n";
+EXPECT
+ok