in reply to Re: Confusing syntax error with grep
in thread Confusing syntax error with grep

No, that would only be the case if the (last set of) parens weren't there.

Replies are listed 'Best First'.
Re^3: Confusing syntax error with grep
by gumpu (Friar) on Aug 12, 2004 at 16:07 UTC

    Nope he is correct, it was a problem with 'and' having lower precedence than ','

    grep ( ( expression) and ( expression) and ( expression ) , @files )

    Is interpreted as

    grep ( ( expression) and ( expression) and ( ( expression ) , @files ) + )

    According to perldoc -f grep, the construct grep( expression, list ) is allowed. But it is indeed confusing to man and machine!.

    Have Fun

      The post to which I replied said ... and ( expression , @files ), not ... and ( expression ) , @files as you used, so my reply *does* apply to the post to which I replied.