Larry Wall wrote:
We have a bit of a problem with negative operators applied to junctions,
as illustrated recently on PerlMonks. To wit, when a native English
speaker writes
if $a != 1 | 2 | 3 {...}
they really mean one of:
if not $a == 1 | 2 | 3 {...}
if $a == none(1, 2, 3) {...}
or, expressed in current understanding of negated ops:
if $a != 1 & 2 & 3 {...}
if $a != all(1, 2, 3) {...}
They specifically do *not* mean
if $a != any(1,2,3) {...}
since that would always be true.
unless $a = none(1,2)
I don't think we can allow this situation to stand. Either we have
to make != and !~ and ne transform themselves via "not raising", or
we have to disallow negative comparisons on junctions entirely.
Opinions?
I go with option 2b: leave the syntax the way it is, but fire off a
warning, not an error when someone does this.
-- Rod Adams