in reply to Checking for an existing URL
my $ua = LWP::UserAgent->new; my $request = HTTP::Request->new('GET' => $url); my $response = $ua->request($request) if ($response->is_error) { ... } else { ... }
Alternatively, you could employ the is_success method for testing for successful retrieval of the passed URL. Furthermore, the actual numeric response code received can be returned with the code method. For further details on HTTP::Response methods, see the HTTP::Response man page.
perl -e 'print+unpack("N",pack("B32","00000000000000000000000111000011")),"\n"'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Checking for an existing URL
by rjimlad (Acolyte) on Sep 29, 2002 at 14:57 UTC |