in reply to Alas poor grep, I thought I knew him well..

Like so much in life, it all depends on operator precedence. In the first case, your && binds more tightly to @REPORT than grep does. This means that as long as @REPORT is true in scalar context (i.e. is not an empty list), the && executes your do block. By adding parenthesis, you clarify the intended precedence and grep gets fed @REPORT and not the presumed return of your do block (which would never return because of your last).

Update: For the technical correctness, the && operator is higher precedence than the , operator (Comma Operator), which creates generates the list fed into grep. Thus swapping && to the low precedence and fixes the issue.

Replies are listed 'Best First'.
Re^2: Alas poor grep, I thought I knew him well..
by Bloodnok (Vicar) on May 08, 2009 at 15:13 UTC
    TFT kennethk - once again you've come up trumps.

    I'll be able to sleep now...

    A user level that continues to overstate my experience :-))