in reply to How to escape metacharacters without backslash it in regex?

or use index.
index($str, $substr) >= 0
is equivalent to
$str =~ /\Q$substr\E/
and
my $re = quotemeta($substr); $str =~ /$re/