http://qs321.pair.com?node_id=431405


in reply to Re: multi-line in-place edits
in thread multi-line in-place edits

perl -0ni -e "print qq({$_})" file

Caveat - this will fail quietly if the file contains any null bytes. -0 with no arguments sets the record separator to \0.

Better to explicitly use -0777. This will cause perl to slurp the whole file, since "there is no legal byte with that value" (quoted from perlrun)