This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Call FETCH once when chomping a tied ref
[perl5.git] / pp.c
diff --git a/pp.c b/pp.c
index 9325d0e..16794ad 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -882,7 +882,7 @@ S_do_chomp(pTHX_ SV *retval, SV *sv, bool chomping)
                    SvIVX(retval) += rs_charlen;
                }
            }
-           s = SvPV_force_nolen(sv);
+           s = SvPV_force_nomg_nolen(sv);
            SvCUR_set(sv, len);
            *SvEND(sv) = '\0';
            SvNIOK_off(sv);