in reply to perl-based server for use by CGI scripts.

I'd go for the second solution as there are some glitches with sharing data inside Apache.
For performance Apache uses more than one process (configurable via (Min|Max)SpareServers),
these cannot easily share data.

On the otherhand with HTTP::Daemon one can create a simple
HTTP/1.1 (not all of HTTP/1.1 of course) webserver in less than 20 lines of code :)
merlyn wrote some Http proxy servers with it.
Or have a look at POE.
  • Comment on Re: perl-based server for use by CGI scripts.