Wijnand has asked for the wisdom of the Perl Monks concerning the following question:
The next subroutine:
sub check_link { my $url = $_[0]; my $realm = 'Privacy Guard'; my $user = 'Admin'; my $pass = '********'; $url =~ s/http:\/\///; $url = $url.':80'; my $ua = LWP::UserAgent->new; $ua->credentials( $url, $realm, $user, $pass ); my $res = $ua->head($url); if ($res->is_error) { return $res->status_line; } else { return $url; } }
gives a: "400 URL must be absolute" error.
if (!$res->is_error) {
gives: 88.159.57.235/roots/lines/wielinga/wie-aaa/wie-sle/wie-hee/wie-bru/index.htm:80
What goes wrong?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: 400 URL must be absolute
by cavac (Prior) on Apr 04, 2022 at 22:03 UTC | |
by Wijnand (Initiate) on Apr 05, 2022 at 09:26 UTC | |
by cavac (Prior) on Apr 05, 2022 at 09:56 UTC | |
by Wijnand (Initiate) on Apr 05, 2022 at 10:10 UTC | |
by hippo (Archbishop) on Apr 05, 2022 at 10:45 UTC | |
by soonix (Chancellor) on Apr 05, 2022 at 11:50 UTC | |
|
Re: 400 URL must be absolute
by LanX (Saint) on Apr 04, 2022 at 19:13 UTC | |
by Wijnand (Initiate) on Apr 05, 2022 at 10:14 UTC | |
by Wijnand (Initiate) on Apr 05, 2022 at 12:47 UTC |