in reply to Re: Syntax error - beginner question
in thread Syntax error - beginner question

Added note on the style thing.. becareful with &&, it has a low high* enough precedence that it gets interpreted early. From perlop...
As more readable alternatives to `&&' and `||' when used for control flow, Perl provides `and' and `or' operators (see below). The short- circuit behavior is identical. The precedence of "and" and "or" is much lower, however, so that you can safely use them after a list oper- ator without the need for parentheses:
Update:* Tnx davido for the correction.

Play that funky music white boy..
  • Comment on Re: Re: Syntax error - beginner question

Replies are listed 'Best First'.
Re: Re: Re: Syntax error - beginner question
by ysth (Canon) on Jan 11, 2004 at 22:29 UTC
    The precedence rules are usually sensible. It's fairly common to combine comparisons with logical operators; hence comparisons have higher precedence.