if ( $str2 =~ /$str1/i ){...
OP stated that the task is to find $str2 in $str1, so that's probably not right.
such as ... escaping them, though that will also be problematic
See davido's answer regarding \Q (as well as quotemeta).
In reply to Re^2: Stupid question about strings...
by Anonymous Monk
in thread Stupid question about strings...
by kepler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |