I figured out an alternative method to handling filehandles which is working nicely so I'm back to dealing with the memory issue. Below you will find some sample code I wrote this morning that simulates the actual program. Basically the main thread launches a login thread which is constantly looking for new login messages. When it sees one it launches its own thread which performs some tasks and then detaches. I'd like your opinion on the memory performance of the code below if you have some time.
Have you read http://www.perlmonks.org/index.pl?node_id=288022 ?
Maybe, just maybe you don't need CGI?
Anyway, you might want to do some checking of memory usage with Benchmark::Thread::Size (available from CPAN) and see what effects different approaches have.
Liz