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)
In reply to Re^2: multi-line in-place edits
by jsprat
in thread multi-line in-place edits
by Tuppence
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |