use IO::Socket; my $socket = IO::Socket::INET->new(PeerAddr => "localhost",                                   PeerPort => 8000,                                   Proto => "tcp",                                   Type => SOCK_STREAM) or die "$@\n"; print $socket "ASCII\nQUIT\n"; my $answer = <$socket>; close($socket); print "Chatserver: $answer\n";