You will also want to check those regular expressions. As they are they won't even compile. URLs contain lots of /s so you will probably want to choose a different delimiter, for example | or {}. Don't forget that . and ? are regex meta characters.
Something along the lines of will be better
By using the \Q \E pair you remove the need for most of the \ escapes and let perl handle the special characters. Aligning the replacement text with the original text also makes it easier to see what you are changing (I'm assuming that you have been convinced to put this in a file).s{\Qhttp://www.mydomain.com/script.pl?key=3\E} {http://www.mydomain.com/script.pl?key=4} s{\Q<font color="blue">\E} {<font color="red">}
In reply to Re: Perl command line search and replace
by hipowls
in thread Perl command line search and replace
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |