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
In reply to Re^3: 'and' greps
by philipbailey
in thread 'and' greps
by snmb_227
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |