Craig,
I have used the following command in scripts to search and replace.
This info care of Darrell Mays How To.
In the example shown below you want to open the file named /root/test.txt, search for the word e-smith and replace it with the word mitel. In addition, the command creates a backup of the original file with the extension .bkup. In this case it creates /root/test.txt.bkup.
perl -n -i.bkup -e 's/e-smith/mitel/i; print;' /root/test.txt
Jon