I have an array
my @array = qw/FOO BAR BAZ/;
and a scalar read from a file containing data like
You can create a regex that matches all of the @array:
my $regex = join '|', map quotemeta, @array; $string =~ $regex;