I have been using $date=$ENV{'DATE_GMT'} in several Perl programs that are called as Server Side Includes with no problem. I am now trying to use it in Perl program that creates the entire html text and it refuses to work. EG, in the test program below I get the result date=none (so $ENV{'DATE_GMT'} must be empty). Yet this code is edited from a counter I wrote that is on the same server, that happily collects and logs the date for me. The only difference is that the counter is pulled via SSI to a .shtml page, whereas this code is stand alone (I.E. in the form http://www.site.com/cgi-bin/test.cgi). What am I doing wrong ?
#!/usr/bin/perl
$gmtdate = $ENV{'DATE_GMT'};
# check ENVs are not empty
if ($gmtdate eq "") {$gmtdate = "none"};
print "Content-type: text/html\n\n";
print "date=$gmtdate";
#!/usr/bin/perl
$gmtdate = $ENV{'DATE_GMT'};
# check ENVs are not empty
if ($gmtdate eq "") {$gmtdate = "none"};
print "Content-type: text/html\n\n";
print "date=$gmtdate";
Comment