logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: LWP::Simple: patch to let you see last error: msg#00039

Subject: Re: LWP::Simple: patch to let you see last error
Ed Avis <ed@xxxxxxxxxxx> writes:

> When LWP::Simple::get() fails it would often be useful to print a more
> informative error message than just 'get failed'.  The following patch
> lets you say
> 
>     $got = get 'http://perl.org/';
>     die "could not get page: $LWP::Simple::error" if not defined $get;
> 
> The error message is not perfect but it is a lot better than nothing.
> $LWP::Simple::error is set by all the functions not just get().

I've decided to not apply this patch.  I want to keep the LWP::Simple
as simple as it can be.  I recommend using the full LWP::UserAgent
interface if you need the extra error information.  Also interfaces
involving globals are not really pleasant.

Regards,
Gisle




Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>