in reply to Stupid question about strings...
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Stupid question about strings...
by AnomalousMonk (Archbishop) on Jul 14, 2014 at 11:55 UTC | |
|
Re^2: Stupid question about strings...
by kepler (Scribe) on Jul 14, 2014 at 08:45 UTC | |
by davido (Cardinal) on Jul 14, 2014 at 16:18 UTC |