To get the status message from a http request from lwp:
my $res = $ua->request($req);
my $errorCode=$res->status_line

----------------------------------------------------------------------------
----
Economic perl programming and perl debugging      http://www.fluxcenter.com
----------------------------------------------------------------------------
----


----- Original Message -----
From: Me <[EMAIL PROTECTED]>
To: Drew Cohan <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, June 22, 2001 5:33 PM
Subject: Re: HTTP::Status status_message($rc) & LWP::Simple


> Do you mean use the result from such a call,
> or how to do such a call? I'm guessing doing
> the call, and a somewhat wild guess is:
>
>     HTTP::Status::status_message($rc)
>
> Assuming $rc has been set to something
>
> You may need to do a:
>
>     use HTTP::Status;
>
> or similar, before you make the call.
>
> And that might mean you need to install the
> HTTP::Status module.
>
> Otoh, I've never used HTTP::Status...
>
> hth.
>
> > How would I adapt the else print statement to use
> > HTTP::Status status_message($rc)?
> >
> > TIA
> >
> > drew
> > -- snip --
> > use LWP::Simple;
> >
> > while (<>){
> > if (get $_) {
> >     # url is ok
> >     print;
> > } else {
> >     # couldn't get url
> >     print "\nAn error occured with $_\n";
> > }
> > }
>
>

Reply via email to