Sary has asked for the wisdom of the Perl Monks concerning the following question:
and here is the input and response i got in cmd: C:\Users\User\Desktop>Crawlertst1.pl Welcome to my webcrawler, Please specify a url in the following format: www.xxx.y www.google.com TCP Connection Success. What I expected was getting the url servers response printed using my @response var. That doesnt happen. Please help^^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:" . $yourURL . "HTTP/1.0\n\n",0); my @response=<SOCKET>; print("@response");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: My Crawler script
by Corion (Patriarch) on Mar 10, 2011 at 07:50 UTC | |
|
Re: My Crawler script
by atcroft (Abbot) on Mar 10, 2011 at 07:49 UTC | |
|
Re: My Crawler script
by Eliya (Vicar) on Mar 10, 2011 at 08:16 UTC | |
|
Re: My Crawler script
by pemungkah (Priest) on Mar 10, 2011 at 08:12 UTC | |
by Sary (Novice) on Mar 13, 2011 at 11:56 UTC | |
by Eliya (Vicar) on Mar 13, 2011 at 12:28 UTC | |
by pemungkah (Priest) on Mar 14, 2011 at 19:12 UTC |