Closed xsawyerx closed 4 years ago
The !
is defined as UnaryOp
, which means it can only accept one value.
! $foo # ok
! defined # ok
! defined $foo # not ok
But it cannot parse more than one argument, even if the second element is an argument to the first element like ! defined $foo
where $foo
is an argument to defined
, rather than an argument to !
.
I tried changing it to OpNameNot
alternative, but that would mess up the precedence.
! defined $x && $y == 2 # ( defined($x) or ( $y == 2 ) )
not defined $x && $y == 2 # not ( ( defined($x) && ( $y == 2 ) ) )
When using it as not
, it will run everything, then call not
on it.
Not sure how to solve it.