diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-06-09 21:24:01 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-06-09 21:24:01 -0700 |
commit | fad4a2e4a4e2d22bf0b29de7f20808f0a01e79a2 (patch) | |
tree | f6b51a40b445bc5fa5ddd5159e0b5422935eba82 /op.c | |
parent | 6a8709a60c31d74562d0cb240c7a34a5768b3a94 (diff) | |
download | perl-fad4a2e4a4e2d22bf0b29de7f20808f0a01e79a2.tar.gz |
Scalar keys assignment through lvalue subs
This used not to work:
sub foo :lvalue { keys %wallet }
foo = 37;
Now it does. It was just a matter of following the right code path in
op_lvalue when the parent op is a leavesublv instead of a sassign.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1681,7 +1681,7 @@ Perl_op_lvalue(pTHX_ OP *o, I32 type) case OP_KEYS: case OP_RKEYS: - if (type != OP_SASSIGN) + if (type != OP_SASSIGN && type != OP_LEAVESUBLV) goto nomod; goto lvalue_func; case OP_SUBSTR: @@ -1690,9 +1690,9 @@ Perl_op_lvalue(pTHX_ OP *o, I32 type) /* FALL THROUGH */ case OP_POS: case OP_VEC: + lvalue_func: if (type == OP_LEAVESUBLV) o->op_private |= OPpMAYBE_LVSUB; - lvalue_func: pad_free(o->op_targ); o->op_targ = pad_alloc(o->op_type, SVs_PADMY); assert(SvTYPE(PAD_SV(o->op_targ)) == SVt_NULL); |