programming-examples/perl/Network/Post query to a CGI.pl
2019-11-15 12:59:38 +01:00

16 lines
345 B
Perl

use IO::Socket;
$socket = IO::Socket::INET->new
(
Proto => "tcp",
PeerAddr => "reference.perl.com",
PeerPort => 80,
);
$socket->autoflush(1);
print $socket "GET /query.cgi?cgi HTTP/1.0\015\012\015\012";
open FILEHANDLE, ">local.html";
while (<$socket>) {
print FILEHANDLE;
}
close FILEHANDLE;
close $socket;