in reply to Re^2: Where is LWP::Simple::get error information stored?
in thread Where is LWP::Simple::get error information stored?
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"; } ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Where is LWP::Simple::get error information stored?
by ajam (Acolyte) on Sep 28, 2012 at 20:16 UTC |