http://www.perlmonks.org?node_id=1009316


in reply to CGI script cannot create file.

As our anonymous monk above says, if you want to know what happened, you really should ensure you log it. using an or die clause with every open ensures you know where you failed.

As to using sudo in a CGI script DO NOT DO THAT set up a directory that the nobody user (or whatever uid your web server runs under) has write access to.

Hope that helps

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."