s/\Q$string\E/$replacement/; # or .. $qstring = quotemeta $string; s/$qstring/$replacement/;