in reply to Re^2: 'and' greps
in thread 'and' greps

Something like this should work for you:

#!/usr/bin/perl use warnings; use strict; my @to_match = qw/his her theirs/; START: for my $line (<DATA>) { for my $item (@to_match) { next START unless $line =~ /$item/; } print $line; } __DATA__ his her theirs asdf his her something else this shouldn't match either