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

[perl #77240] --subname is not ambiguous

Thread Next
From:
Father Chrysostomos via RT
Date:
June 29, 2013 23:11
Subject:
[perl #77240] --subname is not ambiguous
Message ID:
rt-3.6.HEAD-2552-1372547488-931.77240-14-0@perl.org
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About