Interestingly, bing is the one which fails for me:

$ cat ssl.t use strict; use warnings; use Test::More; use LWP::UserAgent; my @hostnames = ( 'google.com', 'microsoft.com', 'bing.com' ); plan tests => 1 + scalar @hostnames; cmp_ok ($LWP::UserAgent::VERSION, '>=', 6.04, 'LWP is at least fairly +recent'); my $ua = LWP::UserAgent->new; for my $host (@hostnames) { my $res = $ua->head ("https://$host/"); is ($res->code, '200', "$host returns 200") } $ prove -v ssl.t ssl.t .. 1..4 ok 1 - LWP is at least fairly recent ok 2 - google.com returns 200 ok 3 - microsoft.com returns 200 not ok 4 - bing.com returns 200 # Failed test 'bing.com returns 200' # at ssl.t line 19. # got: '405' # expected: '200' # Looks like you failed 1 test of 4. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/4 subtests Test Summary Report ------------------- ssl.t (Wstat: 256 Tests: 4 Failed: 1) Failed test: 4 Non-zero exit status: 1 Files=1, Tests=4, 2 wallclock secs ( 0.04 usr 0.02 sys + 0.33 cusr + 0.02 csys = 0.41 CPU) Result: FAIL

405 is "Method Not Allowed" so bing is just disallowing HEAD requests. I am unable to reproduce your errors and am interested to see your code which works in successfully retrieving a response to a HEAD from bing.com.

Addendum: here are the relevant version numbers:


In reply to Re: Error 500 in LWP by hippo
in thread Error 500 in LWP by YarNik

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.