Hello,
with these lines of code
if ($buf =~ /($pattern)/){
$match = $1;
print "MATCH $match\n";
}
I get the error message "unmatched () in regexp ...". No surprise since $pattern is actually a regex, and might contain unmatched ( and similar.
For this reason, if I use \Q, I will no longer have a regex in $pattern, because all \ ? * etc. will be commmented out.
What other option do I have to avoid the error and still be able to match it with $1 in the second line above ?
Thank you,
Grazia