Usually, you would escape special characters with a backslash. However, there is an easier and cleaner way to do this with the \Q and \E characters. These disable metacharacter interpretation within their boundaries.
my ($text, $literal_text) = @_;
return $text =~ /\Q$literal_text\E/;