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

if( $str1 =~ m/\Q$str2/gi ) { ...

The use of the  /g modifier is meaningless in this context, although it does no harm.