adismaug has asked for the wisdom of the Perl Monks concerning the following question:
Regards,#!/usr/bin/perl -w use IO::Socket; use Encode; use utf8; unless (@ARGV > 0) { die "usage: host ..." } $host = shift(@ARGV); $EOL = "\015\012"; $BLANK = $EOL x 2; $remote = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $host, PeerPort => "http(80)", ); unless ($remote) { die "cannot connect to http daemon on $host" } $remote->autoflush(1); while (1) { $msg = "GET /engine3.php?req_sale=5205&page=1\r\n"; $remote->send($msg); while ( <$remote> ) { $temp .= $_; } utf8::encode($temp); print "$temp\n"; undef($temp); sleep(2); # close $remote; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: IO::Socket, Multiple GET.
by Anonymous Monk on Jul 02, 2009 at 11:26 UTC | |
by poolpi (Hermit) on Jul 02, 2009 at 12:28 UTC | |
Re: IO::Socket, Multiple GET.
by jhourcle (Prior) on Jul 02, 2009 at 14:26 UTC | |
by ikegami (Patriarch) on Jul 02, 2009 at 16:58 UTC | |
Re: IO::Socket, Multiple GET.
by jrsimmon (Hermit) on Jul 02, 2009 at 11:48 UTC | |
by adismaug (Acolyte) on Jul 02, 2009 at 11:53 UTC | |
Re: IO::Socket, Multiple GET.
by chomzee (Beadle) on Jul 02, 2009 at 16:05 UTC |