<?xml version="1.0" encoding="windows-1252"?>
<node id="996267" title="Re^3: Where is LWP::Simple::get error information stored?" created="2012-09-28 14:31:58" updated="2012-09-28 14:31:58">
<type id="11">
note</type>
<author id="171588">
BrowserUk</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;For the sake of maintainability though I think I will avoid using this crafty method.&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;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:
&lt;code&gt;
sub getWithStatus {
    my $url = shift;
    my $content;
    open my $RAM, '&gt;', \$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";
}
...
&lt;/code&gt;


&lt;div class="pmsig"&gt;&lt;div class="pmsig-171588"&gt;
&lt;hr /&gt;
&lt;font size=1 &gt;
&lt;div&gt;With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'&lt;/div&gt;
&lt;div&gt;Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.&lt;/div&gt;
&lt;div&gt;"Science is about questioning the status quo. Questioning authority". &lt;/div&gt;
&lt;div&gt;In the absence of evidence, opinion is indistinguishable from prejudice.
&lt;p align=right&gt; [http://thebottomline.cpaaustralia.com.au/|RIP Neil Armstrong]&lt;/p&gt;&lt;/div&gt;
&lt;/font&gt;

&lt;/div&gt;&lt;/div&gt;Social/div</field>
<field name="root_node">
996077</field>
<field name="parent_node">
996095</field>
</data>
</node>
