Hi,
I am doing a sub for checking if a URL is active or not.
The problem is that for some sites it does not work.
Here's the sub
sub checklink{
my ($url) = @_;
my $ua = new LWP::UserAgent;
my $request = new HTTP::Request GET => $url;
my $response = $ua->request($request);
if ( $response->is_success ){
return(1);
}
else {
return(0);
}
}
If I try it on http://www.grn.es it works ($response->code = 200)
But with http://encarta.msn.es it returns 0. ($response->code = 500)
Am I missing something?
Bruno Veldeman
linkpagegen.pl