SyntaxFix
Write A Post
Hire A Developer
Questions
Use \Q to autoescape any potentially problematic characters in your variable.
\Q
if($text_to_search =~ m/\Q$search_string/) print "wee";