Forking is probably the best solution, but, as always, there is more that one way to do it. For a rather exhaustive list of the possibilities i would suggest
Network Programming With Perl. The book covers using
-
fork()
- Threading (not for production systems)
- IO Multiplexing (complex, but works on non-fork systems)
- Pre-forking/pre-threading
- And a ton more information on style, security, and production ready code.
A quick answer is the
fork() solution above. But if you are going to be doing alot of traffic, i suggest giving the book a read.
may the foo be with you