I try to open a file for writing so I can save my data, but the open () command fails. Whats going on?
Generally, the HTTP server will be running as user “nobody”, or “www”, or some other user id that has mimimal privileges. As a result, the directory (where you intend to create the file) must be writeable by this process id. To be on the safe side, always check the return status from the open command to see if it was a success: open (FILE, “/abc/data.txt”) || error (“Could not open file /abc/data.txt”); . . . sub error { my ($message) = @_; print <Oops!