in reply to Runs from console but not as CGI - temp file not created

This is yet another example of why you should always check the return from open(). Instead of

open (DA, "date.tmp");
change it to
open (DA, "date.tmp") or die "Cannot open date.tmp: $!";
and then check your error log. You'll probably find it is indeed a permissions issue just as The Mad Hatter suggested. Unless you've chdir()'d at some point, you probably don't want to write the temp file to the current directory. (In other words, don't change the permissions or ownership of the directory the script is in, write the file to separate tmp directory.)

-sauoq
"My two cents aren't worth a dime.";