use strict; use IO::Socket; use IO::Socket::INET; my $CRLF = chr(13).chr(10); use constant SERVER_PORT => 40411; my $sock = IO::Socket::INET->new(PeerHost => 'localhost', PeerPort => SERVER_PORT, Proto => 'tcp'); if($sock->connected) {   print "KARAMBA\n";   my $request = "";   my $response = "";   while(lc($request) ne "quit" and lc($response) ne "quit")   {            print "Eingabe: "\n";      $request = ;      chomp $request;      $sock->write("$request$CRLF", length($request)+2);      print "YOU wrote: [$request]\n";      $response = $sock->getline();      chomp $response;      $response =~ s!$CRLF$!!g; # to be sure      print "SERVER wrote: [$response]\n";   } }