summaryrefslogtreecommitdiff
path: root/op.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-11-08 06:04:20 -0800
committerFather Chrysostomos <sprout@cpan.org>2013-11-08 08:15:59 -0800
commit2186f8734350df0f69b852c67f593773a77590bc (patch)
treee37ff3878dd458c122881956be04c4333d220e92 /op.h
parent6a642c21192e08a710804b462f8c97902797d5b4 (diff)
downloadperl-2186f8734350df0f69b852c67f593773a77590bc.tar.gz
Warn for all uses of %hash{...} in scalar cx
and reword the warning slightly. See <20131027204944.20489.qmail@lists-nntp.develooper.com>. To avoid getting a warning about scalar context for ‘delete %a[1,2]’, which dies anyway, I stopped scalar context from being applied to delete’s argument. Scalar context is not meaningful here anyway, and the context is not really scalar. This also means that ‘delete sort’ no longer produces a warning about scalar context before dying, so I added a test for that.
Diffstat (limited to 'op.h')
-rw-r--r--op.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/op.h b/op.h
index 1c59ca8e44..8672e4bf0e 100644
--- a/op.h
+++ b/op.h
@@ -250,8 +250,8 @@ is no conversion of op type.
#define OPpEARLY_CV 32 /* foo() called before sub foo was parsed */
/* OP_?ELEM only */
#define OPpLVAL_DEFER 16 /* Defer creation of array/hash elem */
- /* OP_RV2[AH]V OP_KV[AH]SLICE OP_[AH]SLICE */
-#define OPpSLICEWARNING 4 /* warn about %hash{$scalar} */
+ /* OP_RV2[AH]V OP_[AH]SLICE */
+#define OPpSLICEWARNING 4 /* warn about @hash{$scalar} */
/* OP_RV2[SAH]V, OP_GVSV, OP_ENTERITER only */
#define OPpOUR_INTRO 16 /* Variable was in an our() */
/* OP_RV2[AGH]V, OP_PAD[AH]V, OP_[AH]ELEM, OP_[AH]SLICE OP_AV2ARYLEN,