[tpm] Stupid question time!

Dave Doyle dave.s.doyle at gmail.com
Fri Jan 29 13:02:05 PST 2010


the "not" operator is a more loosely binding version of !

because && is stronger the first statement would evaluate as

not ($foo && ($bar ne "") )

If you use ! instead of not both statements would be equivalent.

--
dave.s.doyle at gmail.com


On Fri, Jan 29, 2010 at 3:55 PM, Madison Kelly <linux at alteeve.com> wrote:

> What is the difference between:
>
> if (not $foo && $bar ne "") {}
> if ((not $foo) && ($bar ne "")) {}
>
> I assumed it was mainly an aesthetic/readability thing, but I realize that
> no, it's logically different. Thanks for enlightening me?
>
> Madi
> _______________________________________________
> toronto-pm mailing list
> toronto-pm at pm.org
> http://mail.pm.org/mailman/listinfo/toronto-pm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20100129/150f09ad/attachment.html>


More information about the toronto-pm mailing list