# If we are reading in text strings. chomp( my @arry = <> ); my $pattern = join('|', map quotemeta, @arry); my $regex = qr/$pattern/;