The | character is a metacharacter, and if it exists in $str2, it is being interpreted as alternation. You probably want something like this:
if( $str1 =~ m/\Q$str2/gi ) { ...
Dave
In reply to Re: Stupid question about strings...
by davido
in thread Stupid question about strings...
by kepler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |