Do you want to append to your output file? See open.
If you want to change your input file, you shouldn't read and write to the same file at the same time. Write to a different file and rename it after you've made all your changes.
As a third alternative, have you looked at Tie::File? It allows you to treat a file as an array.
In reply to Re: Write to filehandle without deleting current text
by Corion
in thread Write to filehandle without deleting current text
by learn_perl_se
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |