$s1 = $s2 = "foo\(bar\)";
$b1 = "foo\(bar\)";
$s1 =~ s/\Q$b1\E/replace/;
$b2 = qr/foo\(bar\)/;
$s2 =~ s/$b2/replace/;
JHMxID0gJHMyID0gImZvb1woYmFyXCkiOwoKJGIxID0gImZvb1woYmFyXCkiOwokczEgPX4gcy9cUSRiMVxFL3JlcGxhY2UvOwpwcmludCAiJHMxXG4iOwoKJGIyID0gcXIvZm9vXChiYXJcKS87CiRzMiA9fiBzLyRiMi9yZXBsYWNlLzsKcHJpbnQgIiRzMlxuIjsK