#!/usr/bin/perl -w use strict; use CGI qw( header ); print(header, IOSockGET()); exit; sub IOSockGET { use IO::Socket; my($method) = 'GET'; my($referer) = 'http://www.yahoo.com'; my($agent) = 'Foo 1.00'; my($host) = 'ooopps.sourceforge.net'; my($doc) = '/index.html'; my($socket) = IO::Socket::INET->new ( 'PeerAddr' => $host, 'PeerPort' => 'http(80)', 'Proto' => 'tcp', 'Type' => SOCK_STREAM, 'TimeOut' => 5, ) or die('
Error: Unable to connect to search server
'); print $socket <<__headers__; $method $doc HTTP/1.0 Host: $host Referer: $referer User-Agent: $agent __headers__ my(@output) = <$socket>; close ($socket); return(@output); }