use IO::Socket; use strict; my $socket=new IO::Socket( PeerAddr=>$host, PeerPort=>80, #HTTP Proto=>'tcp', ) or die "cannot create socket\n"; #print the input to the socket print $socket "; #read the input from the socket my $data=<$socket>; print $data; print $socket ""; close $socket