I think it's going to be hard to answer this question definitively the way it is written.

The filehandle problem is hard to ignore since its warnings-spew occupies such a large portion of your post. But the most serious problem is this one:

2016.11.15,14:23:36,ERROR,GENERAL,Script died: Can't locate LWP/Authen +/Session.pm in @INC (@INC contains: G:/development/HiCHperfpkg/bin\.. +\lib\modules G:/development/HiCHperfpkg/bin C:/Perl64/site/lib C:/Per +l64/lib .) at (eval 72) line 2.

Your problem description states that you do not get this message when you test with a wrong URL, but you do get it if you test with the real target URL. It seems likely that the issue manifests itself with those criteria because the LWP::Authen::Session module is being dynamically loaded, on demand, when authentication is needed. If you hit the wrong URL, no authentication is needed, so the module never gets loaded. As soon as you point to the correct URL, authentication is needed, and you get your error message.

So it seems you do not have LWP::Authen::Session installed on your system, or at least not in a place where Perl can find it. The line of code where that module is loaded was not included in your sample code, either. We cannot really look to see the precise problem because the code that is causing the problem happens in a place outside of the code you showed us.

I went to http://search.cpan.org and the interwebs themselves looking for mention of LWP::Authen::Session and came up empty handed. I even grepped through the code of other LWP::* modules that seemed like they might be relevant to find mention of LWP::Authen::Session, and didn't find anything. I'm reluctant to mention this, because as soon as I do (or within a few minutes) someone will find it and expose the inadequacies in my searching. But I'm going with the assumption that LWP::Authen::Session must be an in-house module, not available on CPAN. If that's the case, you'll have to talk to someone at your shop and find out how to get it installed.


Dave


In reply to Re: HTTP::Request - authorization_basic by davido
in thread HTTP::Request - authorization_basic by demichi

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.