in reply to Pattern match array

my $regex = join '|', @prims; while(<>){ print "Found item in $_" if m/$regex/; }

If you wan the items in the array not to be interpreted as regexes, you have to use

my $regex = join '|', map quotemeta, @prims;