diff options
author | Father Chrysostomos <sprout@cpan.org> | 2016-05-19 18:31:56 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2016-05-20 15:56:39 -0700 |
commit | cc5f9b8acb940eaa010ae87bdf61c7c118da5bf7 (patch) | |
tree | dfd3c3e1d76dc847a132c323d33612cfd6faabf4 /pp.c | |
parent | a061ab0bf2cb11304132a96f31a2b0403912e9b6 (diff) | |
download | perl-cc5f9b8acb940eaa010ae87bdf61c7c118da5bf7.tar.gz |
Correct error msg for sub:lvalue{%h{k}} in sassign
This:
sub foo : lvalue { %hash{'key'} }
foo = 3;
was incorrectly giving ‘Can't modify key/value hash slice in list
assignment’. There is no list assignment there.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -5158,7 +5158,8 @@ PP(pp_kvhslice) if (flags) { if (!(flags & OPpENTERSUB_INARGS)) /* diag_listed_as: Can't modify %s in %s */ - Perl_croak(aTHX_ "Can't modify key/value hash slice in list assignment"); + Perl_croak(aTHX_ "Can't modify key/value hash slice in %s assignment", + GIMME_V == G_ARRAY ? "list" : "scalar"); lval = flags; } } |