while () { my $skip; for my $match (@list) { $skip = 1, last if /$match/; } next if $skip; print; }