-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
In reply to Re: modifying and overwriting a file
by chipmunk
in thread modifying and overwriting a file
by mndoci
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |