#!/n/gnu/bin/perl
#
# has to be run on the same directory as rcamp?.txt

use CGI;
$PUBLIC=".";

$query = new CGI;
$title = "Últimos Campeonatos";
print $query->start_html($title);
print $query->h1($title);
print "\n<table>\n";
print "<tr><th>Campeonato" .
    "<th>Data/Hora Início" .
    "<th>Data/Hora Término</tr>\n";
@rcamps = glob("rcamp?.txt");
foreach $rcamp (@rcamps) {
    print "<tr>";
    print "<td>";
    print $query->a({href => $rcamp},$rcamp);
    print "<td>" . `head -2 $rcamp | tail -1`;
    ($final = $rcamp) =~ s/rcamp/final/;
    print "<td>" . `head -1 $final`;
    print "</tr>\n";
}
print "</table>\n";
print $query->end_html;

