diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-11-08 06:04:20 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-11-08 08:15:59 -0800 |
commit | 2186f8734350df0f69b852c67f593773a77590bc (patch) | |
tree | e37ff3878dd458c122881956be04c4333d220e92 /toke.c | |
parent | 6a642c21192e08a710804b462f8c97902797d5b4 (diff) | |
download | perl-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.c | 7 |
1 files changed, 0 insertions, 7 deletions
@@ -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('%'); |