Very similar to awk:
perl -ple'BEGIN { print "new text" }' infile > outfile
perl -i -ple'BEGIN { print "new text" }' file
In reply to Re: Elegant Way of Inserting Text at the Start of the File
by ikegami
in thread Elegant Way of Inserting Text at the Start of the File
by bichonfrise74
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |