Change the line in the loop to
print if /\Q$pattern\E/;
This is equivalent to $pattern= quotemeata($pattern); before the loop. The '$' in your pattern is interpreted as special char in your regex, thats why it isn't working
In reply to Re: regex search fails
by jethro
in thread regex search fails
by stephanm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |