I have created a script designed to change an image depending on what hour it is (i.e. their are 24 hours in a day therefore I have 24 images, 1 for each hour). The syntax seems okay however I am recieving an error 500. Any ideas?
#! /usr/bin/perl
use strict;
use CGI ':standard';
##################################################################################################################################################
#######################
## GMT time and date ##
#######################
my ($gmttime, $hour2);
my ($sec, $min, $hour, $mday, $mon, $year)=gmtime;
$gmttime = sprintf ('%02d/%02d/%4d <b>(time:</b> %02d:%02d:%02d<b>)</b>', $mday, $mon+1, $year+1900, $hour+1, $min, $sec);
$hour2 = $hour+1;
##################################################################################################################################################
##################################################################################################################################################
##################################
## Conditions of image rotation ##
##################################
my ($counter);
while ($counter < 24) {
$counter = 0;
if ($hour2 eq $counter) {
print "Content-type: text/html\n\n";
print <<"HTML code";
<HTML><HEAD>
<TITLE>Image Rotation</TITLE>
</HEAD><BODY>
<p><img border="0" src="Images/$counter.bmp" width="100" height="100"><br>
<font size="2" face="Arial">$gmttime</font></p>
</BODY></HTML>
HTML code
print "";
}
$counter = $counter + 1;
}
##################################################################################################################################################
#########
## End ##
#########
#! /usr/bin/perl
use strict;
use CGI ':standard';
##################################################################################################################################################
#######################
## GMT time and date ##
#######################
my ($gmttime, $hour2);
my ($sec, $min, $hour, $mday, $mon, $year)=gmtime;
$gmttime = sprintf ('%02d/%02d/%4d <b>(time:</b> %02d:%02d:%02d<b>)</b>', $mday, $mon+1, $year+1900, $hour+1, $min, $sec);
$hour2 = $hour+1;
##################################################################################################################################################
##################################################################################################################################################
##################################
## Conditions of image rotation ##
##################################
my ($counter);
while ($counter < 24) {
$counter = 0;
if ($hour2 eq $counter) {
print "Content-type: text/html\n\n";
print <<"HTML code";
<HTML><HEAD>
<TITLE>Image Rotation</TITLE>
</HEAD><BODY>
<p><img border="0" src="Images/$counter.bmp" width="100" height="100"><br>
<font size="2" face="Arial">$gmttime</font></p>
</BODY></HTML>
HTML code
print "";
}
$counter = $counter + 1;
}
##################################################################################################################################################
#########
## End ##
#########