s/\Q$str\E/$new/g; # since \E is at the end, it's not really required.