summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-05-31 18:13:43 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-05-31 18:13:43 -0700
commit145b2bbb325a2181db2f44a0d0576e39e61b2e8b (patch)
treec3bfdcf84fb0094f67df6a26a2cb9320aaa8c17f /op.c
parentfd6c41ce5607a262d2124271d289aa2a0213c049 (diff)
downloadperl-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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/op.c b/op.c
index e1bf3539c5..c493a5f826 100644
--- a/op.c
+++ b/op.c
@@ -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)