#!/usr/local/bin/perl

srand;                      # initialize random seed
$i=0;
while (<../images/*>) {     # loop through directory and get names of images
  $array[$i++] = $_;        # The variable \$_ is a default scalar variable
}

print "Content-type: text/html\n\n";
$image = $array[int(rand($i))];      # Grab random image name

print<<EOF;                          # Print our HTML document
<HTML>
<BODY BGCOLOR="#FFFFFF" TEXT="#006600">
<H1> Random Garden Pictures</H1>
<P>
<IMG SRC="$image">
<BR>
<B><EM>by D. W. Hyatt</EM></B>
<P>
<H3>See the full gallery: 
<A HREF="gallery.pl">
Click Here
</A>
</H3>

</BODY>
</HTML>
EOF


