This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make keys $scalar an lvalue
authorFather Chrysostomos <sprout@cpan.org>
Tue, 19 Apr 2011 04:29:11 +0000 (21:29 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 19 Apr 2011 04:29:32 +0000 (21:29 -0700)
commitd806590792484020987549ec4683b175c90d6263
treea86f5ad78f320212167e68200755801e977bf194
parent006671a67d63718163a0f4771c9dc358db053aad
Make keys $scalar an lvalue

This does a run-time check to see whether $scalar is a hash ref, and
dies if it is not.

This is to keep keys \@_ consistent with keys @_.

I cannot simply use OPf_MOD, since that indicates *potential* lvalue
context (including subroutine args).

So, instead, I take advantage of the fact that OPf_SPECIAL is always
set on the LHS of an assignment (usually to indicate that local()
should not erase the value).
op.c
pp.c
t/op/smartkve.t