$matchtext = q(http://www.foo.bar/somepage.pl?); $substitutetext = "http://www.new.site/somenewpage\?"; s/\Q$matchtext\E/$substitutetext/;