develooper Front page | perl.perl5.porters | Postings from June 2013

[perl #77240] --subname is not ambiguous

Thread Next
Father Chrysostomos via RT
June 29, 2013 23:11
[perl #77240] --subname is not ambiguous
Message ID:
On Mon Sep 24 17:49:45 2012, sprout wrote:
> Fixed by 898c3bc.

No, it was only partially fixed.

The problem still exists in another case:

$ perl -e 'sub foo{}; aa-foo'
Ambiguous use of -foo resolved as -&foo() at -e line 1.

Why is infix negation triggering this?

Spaces help:

$ perl -e 'sub foo{}; aa - foo'

They also help with the unary form:

$ perl -e 'sub foo{}; - foo'

Also, I cannot see for the life of me what is ambiguous about -foo when
foo is a constant or subroutine.  Unary negation does not quote
barewords and never has.  All it does is exempt a bareword following it
from strictures.  It has *no* effect on whether the thing following it
is a bareword or function call.

BTW, some similar ambiguity warnings were removed by fdfe84d0a51e.  I
would like to see this one removed, too.  It’s annoying that I can’t
write -PI without a warning.


Father Chrysostomos

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About