Perhaps you should spend some time learning POE or AnyEvent.
In reply to Re: non-blocking listen on a tcp server by zwon in thread non-blocking listen on a tcp server by monkeyfish