From: Radu Greab Date: Fri, 12 Jan 2001 19:16:09 +0000 (+0200) Subject: Re: [PATCH] [ID 20001223.002] lvalues in list context X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7c8af4ef9d2544e11473e47bd0c86ea792b65202;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH] [ID 20001223.002] lvalues in list context Message-ID: <14943.15321.515713.119805@ix.netsoft.ro> p4raw-id: //depot/perl@8418 --- diff --git a/op.c b/op.c index 7485934..dc51040 100644 --- a/op.c +++ b/op.c @@ -1416,6 +1416,7 @@ Perl_mod(pTHX_ OP *o, I32 type) } else { /* lvalue subroutine call */ o->op_private |= OPpLVAL_INTRO; + PL_modcount = RETVAL_MAX; if (type == OP_GREPSTART || type == OP_ENTERSUB || type == OP_REFGEN) { /* Backward compatibility mode: */ o->op_private |= OPpENTERSUB_INARGS; diff --git a/t/pragma/sub_lval.t b/t/pragma/sub_lval.t index 00080c1..03a2fa0 100755 --- a/t/pragma/sub_lval.t +++ b/t/pragma/sub_lval.t @@ -1,4 +1,4 @@ -print "1..63\n"; +print "1..64\n"; BEGIN { chdir 't' if -d 't'; @@ -527,3 +527,11 @@ while (/f/g) { } print "# @p\nnot " unless "@p" eq "1 8"; print "ok 63\n"; + +# Bug 20001223.002: split thought that the list had only one element +@ary = qw(4 5 6); +sub lval1 : lvalue { $ary[0]; } +sub lval2 : lvalue { $ary[1]; } +(lval1(), lval2()) = split ' ', "1 2 3 4"; +print "not " unless join(':', @ary) eq "1:2:6"; +print "ok 64\n";