I believe the problem you're having here is that CGI.pm is a totally insane piece of code that uses global variables everywhere. To make it work in a persistent environment, you have to call CGI::initialize_globals() at the beginning of every request. It does this automatically when it detects mod_perl.