http://www.perlmonks.org?node_id=170308

perl -0777pi.bak -e 's/line1\nline2/new content/' files ..

UPDATE: why is there no "in reply to Re: How can I match a multi-line regexp?" link