I've got a file containing the text: blah grah and I want to replace those two lines with the string: broohaha I've tried using: perl -pi -e 's/blah\ngrah/broohaha/' file I've also tried: perl -pi -e 's/blah\ngrah/broohaha/s' file perl -pi -e 's/blah\ngrah/broohaha/m' file perl -pi -e 's/blah\ngrah/broohaha/ms' file all with no success. What am I doing wrong? How do I replace a string that spans multiple lines? Thanks, - Jared