in reply to Re: Grep fail condition
in thread Grep fail condition

I want to enter the loop when the grep *fails*.The below condition enters the loop when the grep passes

if (my @matching_files = grep /\Q$key/i, @syncsource_plf) { ... }

Replies are listed 'Best First'.
Re^3: Grep fail condition
by Anonymous Monk on Nov 07, 2010 at 21:12 UTC
    if ( not grep { condition } list ) {

      Getting some syntax errors with the below line

      This works if ( not grep { /\Q$key/i} @files ) { ... } </code>
        If so, it's because you have an error elsewhere.