in reply to Pattern match array
my $regex = join '|', @prims; while(<>){ print "Found item in $_" if m/$regex/; } [download]
If you wan the items in the array not to be interpreted as regexes, you have to use
my $regex = join '|', map quotemeta, @prims; [download]