I have a very basic regex matching question. If the regex expression ($item in this case below) contains a metacharacter, how can I avoid the run time regex error that one gets when such a metachar is encountered in the expression?
e.g. $item = "*varName";
Here is the src line where it blows:
if ($func_def =~ /$item/){...
I know using a backslash to escape them is one solution but $item will be set programatically on the fly. Are there some special regex options that allow for such metachars to be present in the regex expression and for the matching to take place successfully?
Thnx.