my @strings; my $stringFile = ; chomp $stringFile; if ($stringFile eq "") { print "No file of exclude strings specified.\n"; } else { open (STRINGFILE, "$stringFile") or die "Couldn't open $stringFile:$!\n"; @strings = ; } #BLAH BLAH BLAH foreach my $file1(@file1only) { foreach my $string(@strings) { chomp $string; unless ($file1 =~ $string) { print OUT $file1; last; } } }