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.
In reply to Re: what is the best method to read and write in a file in perl
by dasgar
in thread what is the best method to read and write in a file in perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |