diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-01-18 21:30:00 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-01-23 15:18:10 +0000 |
commit | 6fbb66d654f8539b40e6cdc4ce45f9e073f37d64 (patch) | |
tree | d6eb96fc7cf7b5c28f79ddb5953a89e7bae3dc2e | |
parent | 86f12da24a95dda38e6d599b881a5cca226226e4 (diff) | |
download | perl-6fbb66d654f8539b40e6cdc4ce45f9e073f37d64.tar.gz |
Revert change 26410, marking the test that was added there as TODO.
See the thread :
Subject: LVALUE m//g (was Re: au revoir ...)
Message-ID: <20060118203058.GQ616@plum.flirble.org>
p4raw-id: //depot/perl@26926
-rw-r--r-- | op.c | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -1157,9 +1157,8 @@ Perl_mod(pTHX_ OP *o, I32 type) /* FALL THROUGH */ default: nomod: - /* grep, foreach, subcalls, refgen, m//g */ - if (type == OP_GREPSTART || type == OP_ENTERSUB || type == OP_REFGEN - || type == OP_MATCH) + /* grep, foreach, subcalls, refgen */ + if (type == OP_GREPSTART || type == OP_ENTERSUB || type == OP_REFGEN) break; yyerror(Perl_form(aTHX_ "Can't modify %s in %s", (o->op_type == OP_NULL && (o->op_flags & OPf_SPECIAL) @@ -1841,14 +1840,9 @@ Perl_bind_match(pTHX_ I32 type, OP *left, OP *right) } if (!(right->op_flags & OPf_STACKED) && ismatchop) { right->op_flags |= OPf_STACKED; - /* s/// and tr/// modify their arg. - * m//g also indirectly modifies the arg by setting pos magic on it */ - if ( (right->op_type == OP_MATCH && - (cPMOPx(right)->op_pmflags & PMf_GLOBAL)) - || (right->op_type == OP_SUBST) - || (right->op_type == OP_TRANS && - ! (right->op_private & OPpTRANS_IDENTICAL)) - ) + if (right->op_type != OP_MATCH && + ! (right->op_type == OP_TRANS && + right->op_private & OPpTRANS_IDENTICAL)) left = mod(left, right->op_type); if (right->op_type == OP_TRANS) o = newBINOP(OP_NULL, OPf_STACKED, scalar(left), right); |