On Fri, Jan 18, 2002 at 05:57:11PM +0000, Chris Ball wrote:
> OOI, does '&&' have a higher precedence than 'and' in perl?  This seems
> to be the case in php.  I haven't worked out why yet; they're definitely
> both comparison rather than bitwise.  It confuses me.

Yes, 'or' and 'and' has very low precedence. This is useful for writing
stuff like

          frob $foo or frob $bar;

which looks nice and DWIM, unlike

         frob $foo || frob $bar;

which doesn't do what I want, and

     frob($foo) || frob($bar);

which does what I want but doesn't look as natural language-like.

-- 
Niklas Nordebo -><- [EMAIL PROTECTED] -><- +447966251290
 "a windows based machine should not be connected to the internet unless
accompanied by a small, female zebra." -- Robin Szemeti

Reply via email to