Just wrap it in \Q ... \E:
$output =~ /\b\Q$expectedoutput\E\b/i
If $expectedoutput is constant, add an 'o' modifier for efficiency.
PN5
In reply to Re: backslash and word boundaries while matching
by Prior Nacre V
in thread backslash and word boundaries while matching
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |