If you really need to do the analysis
online in real-time and not as batch logfile anaysis
(as mentioned above) I see 2 posibilities:
Real-time log analysis. Have a process that tails the
access logs and counts hits in real-time. This saves
the overhead of having to launch a separate process
each time you want to increment a count.
Use mod_perl. With mod_perl you can run perl inside
of apache so you don't have the overhead of launching a separate
process. With Apache::Registry you can even use
your current cgi-bin perl programs with no modification
and get the "run inside of apache w/o a separate process"
advantage.