Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: multi-line in-place editsby jsprat (Curate) |
on Feb 16, 2005 at 01:18 UTC ( [id://431405]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|