Problem with new HTML::LinkExtor in LWP 5.01

Hans de Graaff (J.J.deGraaff@twi.tudelft.nl)
07 Aug 1996 14:51:33 +0200


I think I have found a problem with the new LinkExtor in LWP
5.01. This module doesn't work when the page it scans contains no
links at all, and when the callback feature isn't used. In that case,
the links() method tries to create an array from an undefined value.

I'm now using the following links() method, which doesn't have this
problem, and which returns undef when no links have been found. Gisle
might want to fix this in a different way when he comes back, though.

sub links
{
    my $self = shift;
    if (defined $self->{'links'}) {
      @{$self->{'links'}};
    } else {
       undef;
    }
}

Hans
-- 
Hans de Graaff                        http://is.twi.tudelft.nl/~graaff/