in reply to Is CGI.pm my best choice?
If you choose to use mod_perl, you can do a bunch of stuff after the request is served using the cleanup handler. This will definitely allow you to have the effect you want for your point 2