I have a script that goes to a https server, requests some information, does a while($sock->read($line, 1024) to get the information, then when all the info is got, carries on.
The problem that I have is that this works fine with an HTTP/1.0 request, since the connection is closed automatically once all the data has been sent. However with HTTP/1.1 , it seems that the connection is kept open, until a "Connection: close" is received.
My question to you: What is the easiest way to change the following so that my script works?
Relevant parts of script:
my $self = shift;
my $host = shift;
my $port = 443;
$sock = Net::SSL->new(
r => $host,
t => $port,
) || warn "couldnt connect\n";
$sock || ($@ ||= "no Net::SSL connection established");
my $error = $@;
$error && die("Can't connect to $host:$port; $error; $!");
od $path HTTP/1.1\nHost: www.blah.net\n\n
$acc .= $test;
@out = split("\are",$acc);
foreach my $line (@out)
$line =~ s/^\n//s;
if($line =~ /^\"/)
Any help is greatly appreciated.