summaryrefslogtreecommitdiff
path: root/toke.c
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 /toke.c
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 'toke.c')
-rw-r--r--toke.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/toke.c b/toke.c
index d871fc46e7..509aa8e3e7 100644
--- a/toke.c
+++ b/toke.c
@@ -5853,13 +5853,6 @@ Perl_yylex(pTHX)
if ((PL_expect != XREF || PL_oldoldbufptr == PL_last_lop) && intuit_more(s)) {
if (*s == '[')
PL_tokenbuf[0] = '@';
-
- /* Warn about % where they meant $. */
- if (*s == '[' || *s == '{') {
- if (ckWARN(WARN_SYNTAX)) {
- S_check_scalar_slice(aTHX_ s);
- }
- }
}
PL_expect = XOPERATOR;
force_ident_maybe_lex('%');