in reply to Re (tilly) 2: Yet another one-liner
in thread Yet another one-liner

Learn to love all of Perl's command line options! perl -pi.bak -0es//\\n/ foo* :)

(Update: If your files may contain null characters, make that perl -pi.bak -0777es//\\n/ foo* instead.)