#!/usr/local/bin/perl
#Displays the date and time. The background and text colors depend on the time of day.
#script: datetime.pl
    $DATE = `/bin/date`;
$HOUR = `/bin/date +%H`;
if ($HOUR < 12)
{
    $bg='white';
    $text='black';
} else {
    $bg='black';
    $text='white';
}

print "Content-type: text/html\n\n";
print <<END;
<HTML><HEAD>
<TITLE>Date and Time</TITLE>
</HEAD>
<BODY bgcolor="$bg" text="$text">
<h1 align=center>$DATE</h1>
</BODY></HTML>
END
