|more useful options|
overwriting a fileby Anonymous Monk
|on Oct 30, 2007 at 10:59 UTC||Need Help??|
Anonymous Monk has asked for the
wisdom of the Perl Monks concerning the following question:
I have a question that I believe must have an obvious answer, but I'm not perl-savvy enough to think of it. I'm lazy, impatient and full of hubris too. (But I have had a look through the tutorial and Q&A sections).
I have a text file that I want to automatically update at regular intervals. Sometimes the number of lines that need to be written to the file is smaller than the number of lines already existing in the file, with the result that some of the lines from the old version of the file are still present after I've over-written it. Is there any way of getting rid of these old,unwanted lines?
(At the moment, I'm just using a simple set of write instructions: