Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by dwatson06 (Friar)
on Jun 20, 2002 at 22:34 UTC ( #176177=perlquestion: print w/replies, xml ) Need Help??

dwatson06 has asked for the wisdom of the Perl Monks concerning the following question:

I need to connect to a cgi script in a subdirectory.
http://theSite.com/subdirectory/new_login.cgi
At what point of the socket connection do you pass the directory location ('subdirectory/newlogin.cgi')?

Originally posted as a Categorized Question.

  • Comment on How can my tcp client call a sub directory when calling a socket connection?

Replies are listed 'Best First'.
Re: 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
    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");
Re: How can my tcp client call a sub directory when calling a socket connection?
by merlyn (Sage) on Jun 20, 2002 at 22:37 UTC
    At no point, if you can help it. If you want to speak HTTP, use LWP::Simple.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://176177]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2023-06-01 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?