This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove -foo ambiguity warning
authorFather Chrysostomos <sprout@cpan.org>
Fri, 5 Sep 2014 03:09:29 +0000 (20:09 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 5 Sep 2014 03:10:19 +0000 (20:10 -0700)
commit7950e9cf39c803dbea774d03b90552b92052b83d
tree8a1e40fe56fdf0ff2fa881386eb3b8d7b5dfb70d
parentca81d15134dd9dc7c213a6d9bbac15adcbc11b08
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.
t/lib/warnings/toke
toke.c