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

if(($ua->request(HTTP::Request->new('HEAD', $url)))->is_success())
and following lines to :
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
    One minor caveat with using HEAD: some off-brand web servers don't give a 200 response if you try to HEAD a CGI.