Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Re: Mysterious Disapperance of file contents

by dtr (Scribe)
on Aug 29, 2003 at 15:40 UTC ( #287721=note: print w/replies, xml ) Need Help??

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://287721]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2020-06-06 21:34 GMT
Find Nodes?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?

    Results (41 votes). Check out past polls.