summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-09-04 20:09:29 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-09-04 20:10:19 -0700
commit7950e9cf39c803dbea774d03b90552b92052b83d (patch)
tree8a1e40fe56fdf0ff2fa881386eb3b8d7b5dfb70d /toke.c
parentca81d15134dd9dc7c213a6d9bbac15adcbc11b08 (diff)
downloadperl-7950e9cf39c803dbea774d03b90552b92052b83d.tar.gz
Remove -foo ambiguity warning
$ ./perl -e 'sub foo{} -foo' Ambiguous use of -foo resolved as -&foo() at -e line 1. There is no ambiguity there, since unary minus does not force its argument to be a bareword; it simply exempts barewords from strictures. This warning also makes it harder to use constantly recently added to POSIX. To avoid that warning, for negative infinity you have to write ‘- Inf’ or ‘-+Inf’, because the most natural way of writing it, ‘-Inf’, warns. See <20140901014232.20757.qmail@lists-nntp.develooper.com> and related messages.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/toke.c b/toke.c
index 87a34dce92..4d33472cd1 100644
--- a/toke.c
+++ b/toke.c
@@ -6474,10 +6474,6 @@ Perl_yylex(pTHX)
just_a_word: {
int pkgname = 0;
const char lastchar = (PL_bufptr == PL_oldoldbufptr ? 0 : PL_bufptr[-1]);
- const char penultchar =
- lastchar && PL_bufptr - 2 >= PL_linestart
- ? PL_bufptr[-2]
- : 0;
bool safebw;
@@ -6686,13 +6682,6 @@ Perl_yylex(pTHX)
if (cv) {
OP *gvop;
- if (lastchar == '-' && penultchar != '-') {
- const STRLEN l = len ? len : strlen(PL_tokenbuf);
- Perl_ck_warner_d(aTHX_ packWARN(WARN_AMBIGUOUS),
- "Ambiguous use of -%"UTF8f" resolved as -&%"UTF8f"()",
- UTF8fARG(UTF, l, PL_tokenbuf),
- UTF8fARG(UTF, l, PL_tokenbuf));
- }
/* Check for a constant sub */
if ((sv = cv_const_sv_or_av(cv))) {
its_constant: