Re: LWP::Simple: patch to let you see last error

2004-06-27 Thread Ed Avis
JUANMARCOSMOREN [EMAIL PROTECTED] writes: $got = get 'http://perl.org/'; die could not get page: $LWP::Simple::error if not defined $get; PLEASE, DON'T ADD GLOBAL VARIABLES!!! I was only following the existing style of Perl's $! variable. Global variables are bad programing!!! It is

Re: LWP::Simple: patch to let you see last error

2004-06-27 Thread Ed Avis
JUANMARCOSMOREN [EMAIL PROTECTED] writes: You make a good point about global variables, however I felt it was overridden by the importance of usable error reporting. The global $! for error messages is rather ugly, but still any good beginner's Perl tutorial recommends to always put $! in every

Re: LWP::Simple: patch to let you see last error

2004-06-27 Thread Ed Avis
Jacinta Richardson [EMAIL PROTECTED] writes: Ed Avis appears to be asking for the LWP::Simple functions to die on failure rather than return a false value. The advantage to this method is that instead of writing: do_this() or die can't do_this...; the programmer merely writes: eval {

Re: LWP::Simple: patch to let you see last error

2004-05-25 Thread Jacinta Richardson
On Mon, 24 May 2004, JUANMARCOSMOREN wrote: Ed Avis wrote: My feeling is that the truly simple interface would throw an exception with an informative message on error, and then you wouldn't have to manually check the return value for each call. But this suggestion wasn't well received

Re: LWP::Simple: patch to let you see last error

2004-05-24 Thread JUANMARCOSMOREN
Ed Avis wrote: On 21 May 2004, Gisle Aas wrote: When LWP::Simple::get() fails it would often be useful to print a more informative error message than just 'get failed'. 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

Re: LWP::Simple: patch to let you see last error

2004-05-21 Thread Ed Avis
On 21 May 2004, Gisle Aas wrote: When LWP::Simple::get() fails it would often be useful to print a more informative error message than just 'get failed'. 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

Re: LWP::Simple: patch to let you see last error

2004-05-09 Thread JUANMARCOSMOREN
Ed Avis wrote: 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