AccountStats 1.0 is a free Perl program (NOT a CGI) that scans Common or Combined
format access_logs and summarizes the account activity for people who
have logged in (name/password) to password (.htaccess/.htpasswd) protected
areas on the system. It make no attempt to figure out the realm
(only a problem if you have multiple realms with different people
having the same names assigned).
You can obtain the script here.
If you like and use these routines - let me know - I would love to hear about it.