in reply to Re: grabbing webpage data w/o additional modules
in thread grabbing webpage data w/o additional modules

Hey,
I was reading that link you provided, and i noticed this:
$sock = IO::Socket::INET->new(PeerAddr => 'www.perl.org', PeerPort => 'http(80)', Proto => 'tcp');
So, can i change the www.perl.org to www-mat.nextel.com but how can i route it to a certian directory, and on top of that, to a script with certian parameters?
Thanks again

Dipul

Replies are listed 'Best First'.
Re: Re: Re: grabbing webpage data w/o additional modules
by Fastolfe (Vicar) on Nov 22, 2000 at 21:14 UTC
    You need to learn to speak HTTP. All IO::Socket does is help you establish network connections. It doesn't do anything as far as the protocol you use on top of that connection (HTTP). After you establish your connect, you need to send a properly formatted HTTP request (e.g.:
    GET /some/directory/file/script.whatever?arguments HTTP/1.0 Host: www.example.com
    And parse the response headers that you get in reply:
    HTTP/1.1 500 Internal Server Error Server: whatever Content-type: text/html My bad.
    See http://www.w3.org/ for details on the HTTP protocols, or examine the LWP and/or the HTTP set of modules for information. You are FAR better off finding a way to use an existing module. Good luck.