#!/usr/bin/perl -wT # viewlog.cgi $|=1; use strict; use lib qw(.); use LogConnect; my $dbh = LogConnect->connect; print "Content-type: text/html\n\n"; my $query = qq(select CLIENT from access_log); my $sth = $dbh->prepare($query); $sth->execute; my %clients; while ($_ = $sth->fetchrow) { $clients{$_}++; } $dbh->disconnect; my @clients = sort {$clients{$b} <=> $clients{$a}} keys %clients; print < Simple Report

Simple Report

Web Client Breakdown

HTML foreach (@clients) { print qq(); } print < HTML
$_$clients{$_}