Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Answer: How can my tcp client call a sub directory when calling a socket connection?

by scottknight (Novice)
on Nov 27, 2004 at 20:23 UTC ( #410741=categorized answer: print w/replies, xml ) Need Help??

Q&A > HTTP and FTP clients > How can my tcp client call a sub directory when calling a socket connection? - Answer contributed by scottknight

This seems to work for me (though I am having bad luck with a D-Link modem at the moment):
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/$filen +ame'}; return '0'; } $sock->print("GET /".$filename." HTTP/1.0\r\n");

  • Comment on Answer: How can my tcp client call a sub directory when calling a socket connection?
  • Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (12)
As of 2016-10-01 19:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (6 votes). Check out past polls.