- #!/usr/bin/perl
- # summary.cgi
- $filearg = "../../counter/data/lutusp_";
- $outstr = "Content-type: text/HTML\n\n";
- $outstr .= "<html>\n<head></head>\n<body bgcolor=#ffffff>\n";
- $outstr .= "<center><font size=+2><b>Summary of Page Hits</b></font><br><br>\n";
- $outstr .= "<table border=1 cellpadding=3>\n";
- $outstr .= "<tr><th>Page</th><th>Count</th></tr>\n";
- foreach $fn (<$filearg*>) {
- $q = $fn;
- $q =~ s/^.*_(.*$)/$1/; # get a title from the filename
- $count = <DATA>;
- close DATA;
- $count =~ s/\n//g;
- $outstr .= "<tr><td>$q</td><td align=right>$count</td></tr>\n";
- }
- $outstr .= "</table>\n</center></body>\n</html>\n";
Raw Paste