#!/usr/bin/perl use warnings; use strict; my @to_match = qw/his her theirs/; START: for my $line () { 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