This isn't strictly true. LWP returns a status code of 500 itself to indicate that something didn't happen as planned on the client side. I have seen this issue most frequently when trying to access a site without setting the required proxy envrironment variable that I need in my company.
C:\>get http://perlmonks.com
C:\>500 Can't connect to www.perlmonks.com:80 (connect: Unknown error)
If the OP had missed a required proxy setting step then this would explain why they could access the file using a browser (presumably set up to use a proxy) but not the script.
As a general point, it may be useful to use LWP::Debug qw(+); to trace the progress of an LWP transaction.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.