in reply to A Perl Server Daemon

It looks like not all output is going to the log. Just the 'usage' output.
You have to change the line print($usage); to print $client2 $usage;.

The output gets garbled if I run the telnet client on windows, but is correct if I run it on Unix.
This is due to the line ending. You can do something like:

elsif (/env/i) {my $out = `set`; $out =~ s/\012/\015\012/g; print $cli +ent2 $out;}
Your server crashes when the first connection is closed because you reuse the $client2 variable.
Changed your Socket object to $socket. Check whether the socket is created and accept from it:
my $socket = IO::Socket::INET->new( Proto => 'tcp', LocalPort => $PORT, Listen => SOMAXCONN, Reuse => 1); # Cant Start Daemon die "can't setup server" unless $socket; # Daemon Up And Running print "[Server $0 accepting clients]\015\012"; while ($client2 = $socket->accept()) { . . .
And get rid of the close at the end of the program.

And last but not least go to your favourite bookstore and buy Lincoln Stein's 'Network Programming'. It will be a real eye-opener.