I am working on a script that processes a https response as it is being received, chunk by chunk. I started off with LWP but since the URI was static (and local) there was no need to load up all of those extra modules, plus I couldn't find a way to loop over the incoming data in a way that would fit with the processing method.
Now I am using Net::HTTPS, but there's a problem. If I use the example given for Net::HTTP, and just change HTTP to HTTPS, everything almost works. The data is returned as expected, however, I get a flood of warnings:
Use of uninitialized value in subroutine entry at /usr/lib64/perl5/site_perl/5.12.2/x86_64-linux-thread-multi/Net/SSL.pm line 222.
Net::SSL line 222: my $n = *$self->{ssl_ssl}->read(@_);
When I dump @_, it looks like the filehandle and scalar are missing when the warning is printed. I'm hoping that someone can shed a little light on this issue. It's so close to working
Thanks#!/usr/bin/perl -w use strict; use Net::HTTPS; my $s = Net::HTTPS->new(Host => 'www.verisign.com') || die $@; $s->write_request(GET => "/", 'User-Agent' => "Mozilla/5.0"); my($code, $mess, %h) = $s->read_response_headers; while (1) { my $buf; my $n = $s->read_entity_body($buf, 1024); die "read failed: $!" unless defined $n; last unless $n; print $buf; }
In reply to Net::HTTPS warnings by msalerno
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |