use IO::Socket; $sock = new IO::Socket::INET ( PeerAddr => '1.1.1.1', PeerPort => '7070', Proto => 'tcp', ); die "Could not create socket: $!\n" unless $sock; print $sock "Hello there!\n"; close($sock);