What Distribution are you using?
Is it be SELinux related?  (If so, get setroubleshootd, by any means 
possible!)

Donovan Niesen wrote:
> I have been troubleshooting a basic perl script that writes to a file.
>  I'm able to run the script from the shell and the script creates the
> file with no problem.  However when I run the same script from a
> browser, it is unable to create the file.
>
> I'm running Apache with mod_perl enabled.  I've set chmod 777 on the
> directory containing the script but still it cannot create a file.
> I've tried creating the output file and giving it 777 permissions as
> well, but the script will not append to it either.
>
> Here is the contents of script I've been testing with:
>
> #!/usr/bin/perl
>
> open (IPLOG,">>ip.log") or die("could not create file");
> print IPLOG $ENV{'REMOTE_ADDR'}."\n";
> close(IPLOG);
>
>
> I feel like I'm missing something basic here...
>
>
>