in reply to Re: To add a string to the content of a file
in thread To add a string to the content of a file
whie (<>) { # ... your code print $_; }
The -i.orig tells it to first rename the original input file to its old name followed by .orig, then run the script and put its output into a new file with the same name as the input file.
I suspect the code snippet you started off with assumed you were running under perl -p.
|
|---|