in reply to perlpie only on files with affected contents

Do be careful with the string matches... the solutions above involving the "grep" utility will get you into trouble if the old girlfriend is "Jane" and a random set of your files happen to contain the name "Janet"...

The same concern could apply to the string substitutions that you do: you should perhaps be careful to set it up like so:

s!\boldgirlfriendname\b!newgirlfriendname!g
(and heaven help you if you ditch a girl with a name like April, May or June... ;)