use strict; use warnings; use IO::Socket::INET; my $socket = IO::Socket::INET->new(PeerAddr => "localhost", PeerPort => 12323, Proto => 'tcp'); print $socket "Hi!"; my $response = <$socket>; print $response; $socket->close();