From your question, it is not clear whether you're using a "normal" CGI script or a mod_perl handler. The site to find answers to questions related to Perl and Apache is
http://perl.apache.org.
In case you're using mod_perl, you might find this interesting.
Liz