retroman
asked on
trouble shoot my counter date code...
This is from a script I got which was made for UNIX, but I'm running on my NT 4.0 with perl 5 installed.
# This section is the main log
$PRINT = "Content-type:\ text/plain\n\n ";
$shortdate = `date +"%D %T %Z"`;
chop ($shortdate);
{
$PRINT;
open (MAINLOG, ">>$mainlog");
print MAINLOG "Time: $shortdate\n";
print MAINLOG "User: $ENV{'REMOTE_USER'}\n";
print MAINLOG "Host: $ENV{'REMOTE_HOST'}\n";
print MAINLOG "Addr: $ENV{'REMOTE_ADDR'}\n";
print MAINLOG "With: $ENV{'HTTP_USER_AGENT'}\n" ;
print MAINLOG "Page: $ENV{'HTTP_FROM'}\n";
print MAINLOG "From: $ENV{'HTTP_REFERER'}\n\n";
close (MAINLOG);
}
The main.log file indicates that it is having trouble getting the date, as seen excerpted below:
Time: The system cannot accept the date entered.
Enter the new date: (mm-dd-yy) The system cannot accept the date entered.
Enter the new date: (mm-dd-yy) The system cannot accept the date entered.
Enter the new date: (mm-dd-yy)
User:
Host:
Addr:
With:
Page:
From:
What do i do to modify this so it can run on my NT machine?
# This section is the main log
$PRINT = "Content-type:\ text/plain\n\n ";
$shortdate = `date +"%D %T %Z"`;
chop ($shortdate);
{
$PRINT;
open (MAINLOG, ">>$mainlog");
print MAINLOG "Time: $shortdate\n";
print MAINLOG "User: $ENV{'REMOTE_USER'}\n";
print MAINLOG "Host: $ENV{'REMOTE_HOST'}\n";
print MAINLOG "Addr: $ENV{'REMOTE_ADDR'}\n";
print MAINLOG "With: $ENV{'HTTP_USER_AGENT'}\n"
print MAINLOG "Page: $ENV{'HTTP_FROM'}\n";
print MAINLOG "From: $ENV{'HTTP_REFERER'}\n\n";
close (MAINLOG);
}
The main.log file indicates that it is having trouble getting the date, as seen excerpted below:
Time: The system cannot accept the date entered.
Enter the new date: (mm-dd-yy) The system cannot accept the date entered.
Enter the new date: (mm-dd-yy) The system cannot accept the date entered.
Enter the new date: (mm-dd-yy)
User:
Host:
Addr:
With:
Page:
From:
What do i do to modify this so it can run on my NT machine?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.