I have had this problem before. In our case, the apache
configuration file was setup to prohibit any writes to
certain directories...
I wrote the file to /tmp and it worked
Hmm, I don't think Apache can control what directories you can
write to from your Perl script, since Perl is writing directly to the file,
not through the http server. You fixed your problem by moving to a directory where the webserver user had
system permissions to write to.