in reply to not: function or operator?
It is documented in perlop, so it theoretically should be an operator. OTOH it certainly works like a function.
It is supposed to be lower precedence than a list operator. At least it is documented that way. So at one point someone had in mind what that was supposed to mean. But I am having some trouble (OK, a lot of trouble) figuring out how to write code that could test for that and demonstrate a difference...
Very specifically, could anyone figure out some sample code that distinguishes between not and my_not after the following code? (Other than the name and games with overrides.)
I certainly can't...sub my_not ($) { shift ? "" : 1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re (tilly) 1: not: function or operator?
by MrNobo1024 (Hermit) on Mar 03, 2001 at 10:32 UTC | |
by tilly (Archbishop) on Mar 03, 2001 at 10:42 UTC | |
by MrNobo1024 (Hermit) on Mar 03, 2001 at 10:47 UTC |