Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Where is LWP::Simple::get error information stored?

by Anonymous Monk
on Sep 28, 2012 at 00:06 UTC ( #996094=note: print w/replies, xml ) Need Help??


in reply to Where is LWP::Simple::get error information stored?

Sadly it isn't stored anywhere, even LWP::UserAgent itself doesn't store that stuff, it forces you to store it

WWW::Mechanize on the other hand stores the responses so you don't have to, it even (optionally, by default ) throws exceptions

  • Comment on Re: Where is LWP::Simple::get error information stored?

Replies are listed 'Best First'.
Re^2: Where is LWP::Simple::get error information stored?
by ajam (Acolyte) on Sep 28, 2012 at 01:40 UTC

    Thanks for the information. I will look into WWW::Mechanize.

Re^2: Where is LWP::Simple::get error information stored?
by Anonymous Monk on Sep 28, 2012 at 13:36 UTC

    LWP::UserAgent doesn't?

    use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->env_proxy; my $response = $ua->get('http://example.org/'); print "HTTP response code was: ", $response->status_line, "\n"; #print "Content was:\n", $response->content, "\n";
    HTTP response code was: 200 OK HTTP response code was: 404 Not Found HTTP response code was: 500 Can't connect to 127.0.0.1:80 (Invalid arg +ument)

      Of course it doesn't, it forces you to store it

      my $response = $ua->get('http://example.org/');

        Oh, and it forces you to store the content, too? How inconvenient!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996094]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2018-07-17 16:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (372 votes). Check out past polls.

    Notices?