If you need something that task specific, then maybe doing something standalone with Net::Server would be a workable approach. You could load up BigModuleTree in your server script and then have the server prefork and wait for inbound work requests. Then just have your cgi script (under mod_perl or not) call out to the standalone server to do the work. You could serialize the CGI parameters and pass them over the connection to control behavior and then read back the response.
POE could be another standalone environment that might work for you.
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.