Hi Murcia,
If i understand your question correctly, Here is my code.
#get the files under a directory using readdir or glob. my @a = qw(text1 text2 text3);# filenames in an array. my @found; foreach my $a (@a) { my $FH; open ($FH, $a) or die ("unable to open $a: $!\n"); while (<$FH>) { if (m/green|blue|red/ && !m/green red blue/) { push @found ,$a; last; } } close $FH; } print $_,$/ for (@found);
Regards,
Murugesan Kandasamy
use perl for(;;);
In reply to Re: regexp exclude a string
by murugu
in thread regexp exclude a string
by Murcia
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |