my @phrases = ( 'phrase one', 'phrase two', 'a different phrase', 'yet another match', 'one more to match', 'single', 'word', 'matches' ); my $regex = join '|', map { "\Q$_\E" } @phrases; my $regex = qr($regex); if ($incoming{text} =~ /$regex/) { # ... }