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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.