#!/usr/bin/perl

# The following are arrays for the hour, month, and day of the week

($sec, $min, $hour, $mday, $mon, $year, $wday, $yday) = localtime(time);
$thishour = (0,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12) [(localtime) [2]];
$thismonth = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[(localtime)[4]];
$thisday = (Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday)[(localtime)[6]];

# Print the results to the page

print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>Thank You!</TITLE>\n";
print "</HEAD>\n";
print "Today is $thisday, $thismonth, $mday, 200";
print $year-100;
print ", $thishour:$min:$sec ";

# Look at the hour and print greeting accordingly

if($hour > 11 && $hour < 18)
{print " PM. Good Afternoon.";}
elsif($hour > 17 && $hour < 24)
{print "PM. Good Evening.";}
else
{print "AM. Good Morning.";}

print "<P>";

print "Day of the week: $wday<P>Day of the year: $yday";

print "</BODY>\n";
print "</HTML>\n";
exit(0);