sivel has asked for the wisdom of the Perl Monks concerning the following question:
The above works very well for me except for one thing. If my internet connection drops for a minute or the site takes a really long time to respond my script hangs until it times out. I wanted to implement a shorter timeout but found that you can only do this with LWP::UserAgent.use LWP::Simple; my $url = 'http://www.domain.com/'; if (head($url)) { print "Does exist\n"; } else { print "Does not exist\n";; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Check if URL exists
by jhourcle (Prior) on May 31, 2007 at 17:09 UTC | |
|
Re: Check if URL exists
by varian (Chaplain) on Jun 01, 2007 at 06:44 UTC | |
by sivel (Initiate) on Jun 04, 2007 at 17:50 UTC |