Re: LWP::Simple::get returns undef for some Web pages

From: Arne Sommer (arne1290_at_springbrett.org)
Date: 12/27/04


Date: Mon, 27 Dec 2004 02:35:08 +0100

dave_nul@hotmail.com wrote:

> I'm trying to write a sub that can get all sorts of Web pages, and find
> that LWP::Simple::get works well for most non-authenticated pages, but
> not for all. Below is some sample code to illustrate. Any ideas on
> why the first get() fails to return anything but undef?
>
>
> use LWP::Simple qw( get );
>
> ## Example of page for which LWP::Simple::get returns undef. Using
> ## LWP::UserAgent does not work, either. Nor does
> ## "use LWP::Simple qw( get $ua );". Those last two ideas are from
> ## suggestions in newsgroup postings.
> print get( 'http://www.worldtimeserver.com/time.aspx?locationid=UTC') .
> "\n";

Accessing the specified URL with a browser gives a (verbose) error
message. The documentation for LWP::Simple::get states that it
returns "undef" if it fails. An error message clearly indicates
failure.

Accessing the URL with telnet gives the shorter "Invalid URL"
error message.

LWP::Simple::get does exactly what it should.

--Arne Sommer...



Relevant Pages

  • DB_File tie error
    ... I've convinced myself that the error message I'm getting from my Perl ... undef $totalpubdb; ... untie %totalpubhash; ...
    (comp.lang.perl.misc)
  • Re: Decimal fieldss precision is too small to accept the numeric you attempted to add
    ... I don't know the Scale and Precision of your Decimal fields, ... case something is actually overflowing (as the error message suggests). ... both of those, still fails. ...
    (microsoft.public.access.queries)
  • Re: Unparsable Record
    ... I tried simply importing 1 column - deleting all the rest. ... Method 'ExecuteTempImexSpec' of object '_WizHook' failed error message. ... If that fails, delete 11 more columns so only the first 11 ... importing the first column - skipping all the other columns, ...
    (microsoft.public.access.externaldata)
  • Re: Closing Form Produces "Runtime Error 2585"
    ... My main concern is that you should NEVER store an easily calculatable entity ... calculated field to give you the Full Name from its component parts as and ... > I'm getting the above referenced error (error message: ... DoCmd, it still fails. ...
    (microsoft.public.access.formscoding)
  • Re: Permanently Disabling Content Advisor
    ... If that fails, post the exact error message to a newsgroup about IE. ...
    (microsoft.public.security)