Philip M
01-29-2004, 12:05 PM
I have the following very simple fragment:
#!/usr/bin/perl
# Get the current day of the month (only $mthday is needed 1-31) #
$mthday = (localtime(time))[3];
### Make sure lastaccess.fil exists in cgi-bin directory and is CHMOD 777 ##
open (SENTOUT, "<lastaccess.fil");
$lastaccessed = <SENTOUT>;
close (SENTOUT);
if ($lastaccessed == $mthday) { # reminders have already been sent out today
exit();
}
open (SENTOUT, ">lastaccess.fil");
print SENTOUT ($mthday);
close (SENTOUT);
exit();
This generates an Internal Server Error, but for the life of me I cannot see why.
Confusingly it seems to work, as the content of lastaceess.fil is 29, today's date.
What simple silly thing have I overlooked? The script is CHMOD 755, in my cgi-bin obviously.
#!/usr/bin/perl
# Get the current day of the month (only $mthday is needed 1-31) #
$mthday = (localtime(time))[3];
### Make sure lastaccess.fil exists in cgi-bin directory and is CHMOD 777 ##
open (SENTOUT, "<lastaccess.fil");
$lastaccessed = <SENTOUT>;
close (SENTOUT);
if ($lastaccessed == $mthday) { # reminders have already been sent out today
exit();
}
open (SENTOUT, ">lastaccess.fil");
print SENTOUT ($mthday);
close (SENTOUT);
exit();
This generates an Internal Server Error, but for the life of me I cannot see why.
Confusingly it seems to work, as the content of lastaceess.fil is 29, today's date.
What simple silly thing have I overlooked? The script is CHMOD 755, in my cgi-bin obviously.