in reply to 400 URL must be absolute

my guess: your regex is deleting the leading "http://" hence making $url relative

update

> ... wie-bru/index.htm:80

ehm ... please inform yourself about URL-syntax and the position of port numbers, they are supposed to come before the file path.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: 400 URL must be absolute
by Wijnand (Initiate) on Apr 05, 2022 at 10:14 UTC

    Sorry, i am not only not a "PerlMonk" but also not a "URL/URI Monk", but i will learn. Thanks...

      To avoid the problem with the realm I used an URI with the user info included. Next subroutine works perfect:

      #----------------------- # Subroutine check_link #----------------------- sub check_link { my $url = $_[0]; my $user = 'Admin'; my $pass = '********'; my $UriInfo = 'http://'.$user.':'.$pass.'@'; $url =~ s/http:\/\//$UriInfo/; my $ua = LWP::UserAgent->new; my $res = $ua->head($url); if ($res->is_error) { return '<FONT COLOR="#FF0000">X</FONT>'; } else { return '<FONT COLOR="#008800">V</FONT>'; } }

      Thank you all for the very meaningful contributions.