in reply to what is the best method to read and write in a file in perl
I agree with moritz's suggestion. However, if you really want to edit in place, you can use the -i option when running your script. I would suggest that you supply a backup extension to that so that perl will backup the file before editing it in place. Without that, perl will overwrite the file and if you made a mistake, you will have lost the original file.
Check out perlrun for more information about the -i flag.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: what is the best method to read and write in a file in perl
by superfrink (Curate) on Sep 17, 2010 at 16:52 UTC |