summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2016-05-19 18:31:56 -0700
committerFather Chrysostomos <sprout@cpan.org>2016-05-20 15:56:39 -0700
commitcc5f9b8acb940eaa010ae87bdf61c7c118da5bf7 (patch)
treedfd3c3e1d76dc847a132c323d33612cfd6faabf4 /pp.c
parenta061ab0bf2cb11304132a96f31a2b0403912e9b6 (diff)
downloadperl-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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 5010065ab9..b37c3652a5 100644
--- a/pp.c
+++ b/pp.c
@@ -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;
}
}