in reply to Grep fail condition

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

Replies are listed 'Best First'.
Re^2: Grep fail condition
by iphone (Beadle) on Nov 07, 2010 at 21:09 UTC

    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) { ... }
      if ( not grep { condition } list ) {

        Getting some syntax errors with the below line

        This works if ( not grep { /\Q$key/i} @files ) { ... } </code>