Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by ajam (Acolyte)
on Sep 28, 2012 at 01:29 UTC ( [id://996095]=note: print w/replies, xml ) Need Help??


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

Thanks for the explanation and an example work around. For the sake of maintainability though I think I will avoid using this crafty method.

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

Replies are listed 'Best First'.
Re^3: Where is LWP::Simple::get error information stored?
by BrowserUk (Patriarch) on Sep 28, 2012 at 18:31 UTC
    For the sake of maintainability though I think I will avoid using this crafty method.

    It is not at all clear to me why you think it need be a maintenance problem. Just wrap it over in a function something like:

    sub getWithStatus { my $url = shift; my $content; open my $RAM, '>', \$content; my $stdoutsaved = select; select *$RAM; my $status = getprint( $url ); select $stdoutsaved; close $RAM; return $status, $content; } ... my( $status, $content ) = getWithStatus( $url ); if( $status ne RC_OK ) { die "Get $url failed with HTTP status: $status"; } ...

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    RIP Neil Armstrong

    Social/div

      Good point.

      For some reason I envisioned just pasting that inline. Obviously it is appropiate to put in a function.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://996095]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2026-05-09 17:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.