Read-only COWs are read-only and should not be treated as though they
were not. This logic is left over from when READONLY+FAKE meant
copy-on-write.
#endif
if (SvREADONLY(sv)) {
if (
- /* its okay to attach magic to shared strings */
- !SvIsCOW(sv)
-
- && IN_PERL_RUNTIME
+ IN_PERL_RUNTIME
&& !PERL_MAGIC_TYPE_READONLY_ACCEPTABLE(how)
)
{
ok
Modification of a read-only value attempted at - line 16.
########
+#
+# And one should not be able to tie read-only COWs
+for(__PACKAGE__) { tie $_, "" }
+sub TIESCALAR {bless []}
+EXPECT
+Modification of a read-only value attempted at - line 3.
+########
# Similarly, read-only regexps cannot be tied.
sub TIESCALAR { bless [] }