in reply to help with link checking
From the LWP documentation :
The libwww-perl response object has the class name
`HTTP::Response'. The main attributes of objects of this
class are:
· The code is a numerical value that indicates the
overall outcome of the request.
so, what you want to do is change
and following lines to :if(($ua->request(HTTP::Request->new('HEAD', $url)))->is_success())
my $response = $ua->request(HTTP::Request->new('HEAD', $url)); if ($response->code == 200) { # url is valid } else { # there's something odd with the URL }
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: help with link checking
by dws (Chancellor) on Mar 07, 2001 at 05:34 UTC |