'course, if you're aiming for something a bit less complicated, there's always: perl -pi -e 's/old text/new text/' filename
...assuming, of course, that that's what you're trying to accomplish (the original question wasn't all that clear on that point)