Also, if you're using some sort of application server for your CGI, it may have built in facility for this. Apache::ASP, HTML::Mason and Apache::AxKit (for example) all have features to support this with little more than a flick of the switch... quite possibly others, too.
------------
:Wq
Not an editor command: Wq