Writing a program in which I read a list of words / characters from one file and search for each of them in another text.
So this is something like:
while(<FILE>){ $findword = $_; for (@text){ if ($_=~ /$find/){ push(@found, $_); } } }
However, I ran into a problem when brackets appear. This gives me this error:
Unmatched ( in regex; marked by <-- HERE in m/( <-- HERE
I understand this because Perl believes that ( is part of the regular expression, but how do I deal with it and make it ( searchable?
source share