#!/usr/bin/perl use strict; use IO::Socket::INET; my $host = "www.google.com"; my $port = 80; my $fh = new IO::Socket::INET( PeerAddr => $host, PeerPort => $port, Proto => 'tcp', Timeout => 5, ) or die "$!"; print "sending\n"; print $fh "message\n"; print "send done\n";