Since your code works correctly for us, but not for you, you will have to do the debugging. You may need to tell LWP to use a proxy; check your web-browser to see whether it has a proxy configured. Here are some documents on LWP proxy use and debugging:

Also, from your "Content-type: text/html\n\n" statement, I take it that you are testing this program as a CGI script on a web server. Can you test it from the command line instead? If so, you will be able to see error output that would have been hidden by the web server. Get as much working from the command line as you can, and only then turn it into a CGI; much aching of the head will be avoided.


In reply to Re: Re: replacement for LWP::Simple ? by Util
in thread replacement for LWP::Simple ? by Anonymous Monk

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.