I cannot see where you set up
$ui. Presumably it is with
$IO::Socket::INET->new(). At any rate, I'd try a print of the
inet_ntoa($remote_host) just after the
my just in case your debuggery is incorrect. I say that because the
close appears to be after the
if and inside, not after, the
while.
Update: You might want to send the client a message before the close, too. Also, $client->autoflush(1); is probably a good idea, too.
HTH, --traveler