my $sock = IO::Socket::INET->new( PeerAddr => $host, PeerPort => $port, Proto => 'tcp', Timeout => 5 ); unless ($sock) { $errormessage = $tr{'could not connect to http://$host:$port/$filename'}; return '0'; } $sock->print("GET /".$filename." HTTP/1.0\r\n");