Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Problems? Is your data what you think it is?
 
PerlMonks  

Re: LWP:UserAgent Use of uninitialized value in subroutine entry at blib\lib\Net\SSLeay.pm

by Khen1950fx (Canon)
on Mar 26, 2013 at 23:45 UTC ( #1025606=note: print w/ replies, xml ) Need Help??


in reply to LWP:UserAgent Use of uninitialized value in subroutine entry at blib\lib\Net\SSLeay.pm

%missingusers is the uninitialized value. If you look a little deeper you'll find out the real problem:

#!/usr/bin/perl -l use strict; use warnings; use LWP::UserAgent; my $ua = new LWP::UserAgent; my $req = HTTP::Request->new( POST => 'https://api.twitter.com/1/users/lookup.json'); if ($ua->is_protocol_supported('https')) { print "HTTPS is allowed"; } else { print "This is HTTP-only"; } my $res = $ua->request($req); if ($res->is_success) { print $res->as_string; } else { print "Failed: ", $res->status_line; print $res->decoded_content; }


Comment on Re: LWP:UserAgent Use of uninitialized value in subroutine entry at blib\lib\Net\SSLeay.pm
Select or Download Code
Re^2: LWP:UserAgent Use of uninitialized value in subroutine entry at blib\lib\Net\SSLeay.pm
by cormanaz (Chaplain) on Mar 27, 2013 at 12:41 UTC
    I didn't post the whole code because nobody could run it--%missingusers gets populated from a database. It actually works despite throwing that error, so I don't understand why Net::SSleay is even invoked if it's not needed for LWP::UserAgent to work.

      "I don't understand why Net::SSleay is even invoked if it's not needed for LWP::UserAgent to work."

      Your target is https://api.twitter.com/1/users/lookup.json LWP::UserAgent states:

      "You will need to install LWP::Protocol::https separately to enable support for processing https-URLs."

      LWP::Protocol::https requires Net::SSleay.

      Update: fixed typo.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025606]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (17)
As of 2014-04-16 14:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (428 votes), past polls