in reply to Re: Stupid question about strings...
in thread Stupid question about strings...

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).

Replies are listed 'Best First'.
Re^3: Stupid question about strings...
by SimonPratt (Friar) on Jul 14, 2014 at 14:14 UTC

    You're quite right, not sure what I was thinking!