thatguy has asked for the wisdom of the Perl Monks concerning the following question:
TIA, Jack.
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; }
|
---|
Replies are listed 'Best First'. | |
---|---|
•Re: Limiting the size of a HTTP::Request
by merlyn (Sage) on Mar 06, 2003 at 19:22 UTC | |
by thatguy (Parson) on Mar 06, 2003 at 19:28 UTC | |
Re: Limiting the size of a HTTP::Request
by hossman (Prior) on Mar 06, 2003 at 19:01 UTC | |
by thatguy (Parson) on Mar 06, 2003 at 19:24 UTC | |
by hossman (Prior) on Mar 06, 2003 at 21:41 UTC | |
Re: Limiting the size of a HTTP::Request
by phydeauxarff (Priest) on Mar 06, 2003 at 19:08 UTC |