use IO::Socket::INET;
use warnings;
use strict;
my $host = "www.google.com";
my $counter = 0;
my $line = "";
my @html;
my $sock = IO::Socket::INET->new(PeerAddr => "$host",
PeerPort => 80)
or die "Didn't work!";
print $sock "GET / HTTP/1.1\n\n";
while($line ne "0") {
$line = <$sock>;
$html[$counter] = $line;
$counter++;
}
print "@html";
| Posted by dhaivat on Wed 3 Mar 2010 14:05 | 218 views
- Syntax: None
- Expires: never
- Report
- IMG
- Download
-
|
