sub check_url{ my $return; my $url=shift; chomp($url); #$url=~ s/^http:\/\///i; #$url="http://$url"; my $ua = LWP::UserAgent->new; $ua->agent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"); # Create a request my $req = HTTP::Request->new(GET => $url); # Pass request to the user agent and get a response back my $res = $ua->request($req); # Check the outcome of the response unless ($res->is_success) { $return="404"; } return $return; }