counting tr/// corrupts later operation (from M.J.T Guy)
[p5sagit/p5-mst-13.2.git] / doop.c
diff --git a/doop.c b/doop.c
index 4224b0e..835dac6 100644 (file)
--- a/doop.c
+++ b/doop.c
@@ -592,7 +592,8 @@ Perl_do_trans(pTHX_ SV *sv)
        return 0;
     if (!SvPOKp(sv))
        (void)SvPV_force(sv, len);
-    (void)SvPOK_only(sv);
+    if (!(PL_op->op_private & OPpTRANS_IDENTICAL))
+       (void)SvPOK_only_UTF8(sv);
 
     DEBUG_t( Perl_deb(aTHX_ "2.TBL\n"));