in reply to Re: Mysterious Disapperance of file contents
in thread Mysterious Disapperance of file contents
The effect of these two lines will be so that when you run the script for the first time, the open(filehandle, filename) || die doesn't die because the file does not exist.
Otherwise, the script would die continuously until you manually created the file. In theory, the ">>" (append) should prevent data from being overwritten in the file if it does exist and you crash with an open filehandle - although that's perhaps not the safest way of doing things.
Try removing these lines, and putting a &CreateFile() unless -e $filename; earlier on in the code instead.
|
---|