diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-05-31 18:13:43 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-05-31 18:13:43 -0700 |
commit | 145b2bbb325a2181db2f44a0d0576e39e61b2e8b (patch) | |
tree | c3bfdcf84fb0094f67df6a26a2cb9320aaa8c17f /op.c | |
parent | fd6c41ce5607a262d2124271d289aa2a0213c049 (diff) | |
download | perl-145b2bbb325a2181db2f44a0d0576e39e61b2e8b.tar.gz |
Allow rvalue syntax in expr returned from lvalue sub
This changes the syntax of the last statement and the arguments to
‘return’ in an lvalue subroutine to be the same as that of a non-
lvalue routine. This almost finishes the work begun by commit fa1e92c.
(return still needs to enforce the same rules as leavesublv.)
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1569,7 +1569,8 @@ Perl_op_lvalue(pTHX_ OP *o, I32 type) default: nomod: /* grep, foreach, subcalls, refgen */ - if (type == OP_GREPSTART || type == OP_ENTERSUB || type == OP_REFGEN) + if (type == OP_GREPSTART || type == OP_ENTERSUB + || type == OP_REFGEN || type == OP_LEAVESUBLV) break; yyerror(Perl_form(aTHX_ "Can't modify %s in %s", (o->op_type == OP_NULL && (o->op_flags & OPf_SPECIAL) |