Re: LWP::Simple::get returns undef for some Web pages
From: Arne Sommer (arne1290_at_springbrett.org)
Date: 12/27/04
- Next message: mike: "Howto run pre-install perl modules"
- Previous message: David Golden: "[ANNOUNCE] Test::Float -- compare numbers to specified precision"
- In reply to: dave_nul_at_hotmail.com: "LWP::Simple::get returns undef for some Web pages"
- Next in thread: dave_nul_at_hotmail.com: "Re: LWP::Simple::get returns undef for some Web pages"
- Reply: dave_nul_at_hotmail.com: "Re: LWP::Simple::get returns undef for some Web pages"
- Reply: Sherm Pendley: "Re: LWP::Simple::get returns undef for some Web pages"
- Reply: Sherm Pendley: "Re: LWP::Simple::get returns undef for some Web pages"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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...
- Next message: mike: "Howto run pre-install perl modules"
- Previous message: David Golden: "[ANNOUNCE] Test::Float -- compare numbers to specified precision"
- In reply to: dave_nul_at_hotmail.com: "LWP::Simple::get returns undef for some Web pages"
- Next in thread: dave_nul_at_hotmail.com: "Re: LWP::Simple::get returns undef for some Web pages"
- Reply: dave_nul_at_hotmail.com: "Re: LWP::Simple::get returns undef for some Web pages"
- Reply: Sherm Pendley: "Re: LWP::Simple::get returns undef for some Web pages"
- Reply: Sherm Pendley: "Re: LWP::Simple::get returns undef for some Web pages"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|