in reply to simple text substitution.

You are using the wrong switch. The switch you are looking for is not -n but -p. If you want the file to be edited in place, use the -i switch.

As an example: to change all occurances of foo in bar in a file:

perl -pi -e 's/foo/bar/g' file

See perlrun for more on perl command switches.

HTH,
Paul