p4raw-id: //depot/perl@17984
(void)SvPV(sv, len);
if (!len)
return 0;
- if (!SvPOKp(sv))
- (void)SvPV_force(sv, len);
- if (!(PL_op->op_private & OPpTRANS_IDENTICAL))
+ if (!(PL_op->op_private & OPpTRANS_IDENTICAL)) {
+ if (!SvPOKp(sv))
+ (void)SvPV_force(sv, len);
(void)SvPOK_only_UTF8(sv);
+ }
DEBUG_t( Perl_deb(aTHX_ "2.TBL\n"));
require './test.pl';
}
-plan tests => 97;
+plan tests => 99;
my $Is_EBCDIC = (ord('i') == 0x89 & ord('J') == 0xd1);
eval '$foo{bar} =~ tr/N/N/';
is( $@, '', 'implicit count outside hash bounds' );
is( scalar keys %foo, 0, " doesn't extend the hash");
+
+$x = \"foo";
+is( $x =~ tr/A/A/, 2, 'non-modifying tr/// on a scalar ref' );
+is( ref $x, 'SCALAR', " doesn't stringify its argument" );