I'm writing a program that reads a list of regular expressions from file. For example:
s/\s*M\s*/MALE/si
s/\s*F\s*/FEMALE/si
This is designed to provide a configurable list of regular expressions to apply to later data. Later on in the program I'm applying the rules like so:
$value =~ $regex;
Unfortunately, nothing is happening. Am I attempting to use the regexes from file the wrong way? Do I need to do something else to the list of regexes before Perl will treat them as it would if I had typed them in to a Perl script?