Help with checklinks.pl

I was looking for a link checker integrated as tool on my website. I found checklinks from Jim Weirich ( https://www.linuxjournal.com/article/2026 and want to use it as fundament for my application. The problem where some syntax errors but only one I don't understand:

# ScanUrl
# ------------------------------
# We have a URL that needs to be
# scanned for further references to
# other URLs. We create a request to
# fetch the document and give that
# request to the UserAgent responsible
# for doing the fetch.

sub ScanUrl {
    my($url) = @_;
    $currentUrl = $url;
    push (@isScanned, $url);
    print "Scanning $url\n";
    $request  = new HTTP::Request (GET => $url);
    $response = $agent->request ($request, \&HandleDocChunk);
#    if ($response-7gt;is_error) {
#     die "Can't Fetch URL $url\n";
#    }
    $parser->eof;
}

I comment it out here what was giving the error:

syntax error at checklinks.pl line 131, near "gt;"
Not enough arguments for HTTP::Status::is_error at checklinks.pl line 131, near "is_error) "
syntax error at checklinks.pl line 135, near "}"
Can't use global @_ in "my" at checklinks.pl line 153, near "= @_"
syntax error at checklinks.pl line 163, near "}"
Execution of checklinks.pl aborted due to compilation errors.

Can somebody help me???
Thanks and regards...

You should post the entire script with the line numbers included since you are posting error messages that refer to line numbers.

Oh, that's a very long script! It's where the if statement is comment out. it can also be found by the error report: near "gt" and "is_error".

1 Like

Hi @Wijnand,

try to replace response-7gt;is_error by response->is_error.
There is also a tool linkchecker(1) - Linux man page.

1 Like

I'm pretty familiar with PERL, but "$response-7gt;is_error" was really Chinese to me. Of course I should have recognized that "-7". Thanks a lot, it works perfect. Regards...