This is a problem from a cgi script but I can't see how it can be an apache/cgi problem. I have a cgi script that tries to open a file int eh cgi-bin folder for writing. the -W and -w tests show that the script can write to the file. However when I try to open the file using open(THEFILE ">>/var/ I get a failure with permission denied in the $! variable. It have tried every possible permissions setting on the file itself and the folder it lives in. Is there some situation wehre the -w and -W tests fail to work?