From: "Yitzchak Scott-Thoennes" <sthoenna@efn.org>
Message-ID: <47935.71.32.86.11.
1204678469.squirrel@webmail.efn.org>
p4raw-id: //depot/perl@33457
PERL_ARGS_ASSERT_DO_TRANS;
- if (SvREADONLY(sv)) {
+ if (SvREADONLY(sv) && !(PL_op->op_private & OPpTRANS_IDENTICAL)) {
if (SvIsCOW(sv))
sv_force_normal_flags(sv, 0);
- if (SvREADONLY(sv) && !(PL_op->op_private & OPpTRANS_IDENTICAL))
+ if (SvREADONLY(sv))
Perl_croak(aTHX_ PL_no_modify);
}
(void)SvPV_const(sv, len);
require './test.pl';
}
-plan tests => 117;
+plan tests => 118;
my $Is_EBCDIC = (ord('i') == 0x89 & ord('J') == 0xd1);
is($c, "\x20\x30\x40\x50\x60", "tr/\\x00-\\x1f//d");
}
+($s) = keys %{{pie => 3}};
+my $wasro = Internals::SvREADONLY($s);
+{
+ $wasro or local $TODO = "didn't have a COW";
+ $s =~ tr/i//;
+ ok( Internals::SvREADONLY($s), "count-only tr doesn't deCOW COWs" );
+}