#!/usr/bin/perl -w
##################
&static;
foreach(<*>) {
  next if($_ =~ /~/);
  next if($_ =~ /cgi/);
  if($_ =~ /jpg/) {
    print "<tr><td bgcolor=#EEEEEE><font face=\"Arial, Helvetica\"><img border=0 src=\"/icons/image2.gif\" alt=\"\">&nbsp;&nbsp;<a href=\"$_\">$_</A></td>\n";
    $commentfile = ".$_-comment";
    if (-e $commentfile) {
      open(COMMENT, ".$_-comment");
      $comment = <COMMENT>;
      print "<td><font face=\"Arial, Helvetica\">$comment</td></tr>";
      close(COMMENT);
    }
  } else {
    print "<tr><td bgcolor=#EEEEEE><font face=\"Arial, Helvetica\"><img border=0 src=\"/icons/folder.gif\" alt=\"\">&nbsp;&nbsp;<a href=\"$_\">$_</A>/</td>\n";
    $commentfile = ".$_-comment";
    if (-e $commentfile) {
      open(COMMENT, ".$_-comment");
      $comment = <COMMENT>;
      print "<td><font face=\"Arial, Helvetica\">$comment</td></tr>";
      close(COMMENT);
    }
  }
}
&end;

sub static {
  print <<END;
Content-Type: text/html

<html>
<head><title>Photos</title></head>
<body bgcolor=#FFFFFF>
<table>
<tr><td bgcolor=#EEEEEE><font face="Arial, Helvetica"><a href="../">../</a></td>\n<td><font face="Arial, Helvetica">Previous Dir</td></tr>
END
}

sub end {
  print <<END;
</table>
<center><a href="http://bazza.com/"><img src="/bazza.com-icon.jpg" border=0></a><center>
</body>
</html>
END
}


syntax highlighted by Code2HTML, v. 0.9