in reply to modifying and overwriting a file
-p loops over the input, reading it into $_ and printing it back out. -l handles line-endings. -i modifies files in place.#!perl -pli $_ .= '_' unless $. == 1; # append underscore, except on first line close ARGV if eof; # reset line numbering at end of file
|
|---|