Sary has asked for the wisdom of the Perl Monks concerning the following question:
The response I always get is 404 not found. Cant seem to find my mistake, would someone light my fire?:] Thanks, alex.use strict; use IO::Socket; use local::lib; print("Welcome to my webcrawler, \n Please specify a url in the following format : www.xxx.y \n"); chomp(my $yourURL=<STDIN>); my $sock = new IO::Socket::INET ( PeerAddr => $yourURL, PeerPort => '80', Proto => 'tcp', ); die "Could not create socket: $!\n" unless $sock; print ("TCP Connection Success. \n"); send($sock,"GET /HTTP/1.1\n\n",0); my @response=<$sock>; print("@response");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTTP request
by Eliya (Vicar) on Mar 13, 2011 at 14:47 UTC | |
by sauoq (Abbot) on Mar 13, 2011 at 15:01 UTC | |
by afoken (Chancellor) on Mar 14, 2011 at 17:31 UTC | |
by sauoq (Abbot) on Mar 15, 2011 at 18:21 UTC | |
|
Re: HTTP request
by marto (Cardinal) on Mar 13, 2011 at 13:45 UTC | |
by Sary (Novice) on Mar 14, 2011 at 12:10 UTC | |
by marto (Cardinal) on Mar 14, 2011 at 12:23 UTC | |
|
Re: HTTP request
by sauoq (Abbot) on Mar 13, 2011 at 14:38 UTC |