perl -i # edit in place .bak # rename original file by appending .bak to filename; print to n +ew file with original name -p # use a while loop to read each file; print each line (is stored + in $_) which you have read (and modified) e # excecute code from command line ' # start of code to be executed (for the default while loop) $_ # default variable, each line of file .= # append the following to yourself ($_) and assign it to you "\n" # string to be appended ' # end of code
$_ .= "\n"; is the shorter form of $_ = $_ . "\n";
Check perlrun and look for the explanation for option -i. They have some examples there. -p should be explained in more details, too.
In reply to Re^3: IO::Handles ... any good?
by linuxer
in thread IO::Handles ... any good?
by blowupp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |