
my $title = "$ARGV[0] Validation Plots";
my $datestring=`date`;
chop($datestring);

printf("<html><head>\n");
printf("<title>$title</title>");

printf("</head><body><h1>$title</h1>");

my $runs=`cat rungroup.txt`;
printf("<h2>Runs: [<font color=blue size=2>$runs</font>]\n</h2><br><hr>");

printf("<br>Generated: $datestring<br>\n");

my @logs = `ls *log`;
if (@logs eq 0) { @logs = `ls log.*`; }

foreach my $f (@logs) 
{
    chop($f);
    printf("Logfile: <a href=\"$f\">$f</a><br>\n");
}

my $ext="gif";
my @plots = `ls *.gif`;
if ( !@plots ) { @plots = `ls *.jpg`; $ext="jpg"; }

foreach my $f (@plots) 
{
    chop($f);
    ($n,$ext) = split(/\./,$f);
    printf("<a href=\"$n.eps\"><img src=\"$n.$ext\"></a>\n");
}

my $files = `cat files.list`;

printf("<hr><br>List of files used:<pre>$files</pre>\n");
printf("</body></html>");

