Add s///r (non-destructive substitution).
[p5sagit/p5-mst-13.2.git] / pp_ctl.c
index 2408a7b..7b94587 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -325,7 +325,10 @@ PP(pp_substcont)
            SvPV_set(dstr, NULL);
 
            TAINT_IF(cx->sb_rxtainted & 1);
-           mPUSHi(saviters - 1);
+           if (pm->op_pmflags & PMf_NONDESTRUCT)
+               PUSHs(targ);
+           else
+               mPUSHi(saviters - 1);
 
            (void)SvPOK_only_UTF8(targ);
            TAINT_IF(cx->sb_rxtainted);