Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: Mysterious Disapperance of file contents

by dtr (Scribe)
on Aug 29, 2003 at 15:40 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-03-29 06:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found