Hello ppp,
Please see the entry “How do I change, delete, or insert a line in a file, or append to the beginning of a file?” in perlfaq5. Note the following:
The basic idea of inserting, changing, or deleting a line from a text file involves reading and printing the file to the point you want to make the change, making the change, then reading and printing the rest of the file. Perl doesn't provide random access to lines...
Once the new file has been written successfully, delete the original and rename the new file using either the builtin rename function or the move function from File::Copy.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: How to delete a particular line in a text file after some operation on that text file at the same time
by Athanasius
in thread How to delete a particular line in a text file after some operation on that text file at the same time
by ppp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |