- or download this
my $host = 'localhost';
my $path = '/cgi-bin/second.pl';
my $port = 80;
- or download this
my $CONN = IO::Socket::INET->new("$host:$port")
or die "Couldn't connect: $!";
- or download this
my $req = "GET $path HTTP/1.0 $CRLF$CRLF";
$CONN->syswrite($req);
- or download this
$/ = CRLF . CRLF; #To read the whole header as one 'line'
binmode $CONN; #Turn off \n conversion for getline() in next line
...
Content-Length: 294
Connection: close
Content-Type: text/html
- or download this
my $CONN = IO::Socket::INET->new(
Peerhost => $host,
Peerport => 'http(80)',
) or die "Couldn't connect: $!";
- or download this
Use of uninitialized value $header in substitution (s///) at 4perl.pl
+line 55.
Use of uninitialized value $header in say at 4perl.pl line 56.
- or download this
use strict;
use warnings;
...
say $header;
$CONN->close;