grektokomus has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I'm working on a simple script to retrieve JSON from an HTTPS web service. The code is being developed on a Windows 2008 server with Active Perl. The script reports an error on compilation, but then successfully retrieves the desired JSON from the Server. I've put substantial effort into eliminating the error and now seek assistance. Here is the declaration and the error:

#!/usr/bin/perl -w use strict; #use diagnostics; use JSON -support_by_pp; use LWP 6.04; use LWP::UserAgent; use LWP::Protocol::https; use Net::SSLeay 1.63; use IO::Socket::SSL 1.997;
Use of uninitialized value in subroutine entry at blib\lib\Net\SSLeay.pm (autosplit into blib\lib\auto\Net\SSLeay\randomize.al) line 912.

Based on a few similar problems found on the internet, I have verified my LWP modules. I have updated to the latest SSLeay Module (which required force install with ppm). I have also installed OpenSSL 1.0.1h from slproweb.com (although when I verify using https://gist.github.com/dolmen/10096474, it confirms 1.0.1g) .

I would greatly appreciate guidance to resolve this issue.

Replies are listed 'Best First'.
Re: Error with Net::SSLeay
by toolic (Bishop) on Jul 28, 2014 at 20:50 UTC
    Use of uninitialized value in subroutine entry at
    That is a warning message, not a compilation error. It sounds like your code is behaving as expected, other than the warning. Currently, you enable warnings globally (even in your use'd modules) because you use -w. You could only enable warnings locally in your file with:
    use warnings;

    Refer to What's wrong with -w and $^W

Re: Error with Net::SSLeay
by aitap (Curate) on Jul 29, 2014 at 09:26 UTC

    Try using Carp::Always to get a backtrace at the point of the warning and walk your way through the subroutine calls from the source code of your application to the offending line of Net::SSLeay.

    Using integrated debugger to set a breakpoint at the starting line of backtrace (one you found it) (f yourprogram.pl, b linenumber, c) and examine your data (x $variable, V, y) can also shed light on the situation. See also break on warning in debugger.