in reply to How to check if a website is up?
This simplest solution is LWP::Simple
an alternative is using a get:use LWP::Simple; my $url="http://cpan.org"; if (! head($url)) { die "The Server is DOWN!!!!" }
but that would fetch the content of the page. A head call uses the least resources, just telling you weather the machine is responding to that url.if (! get($url)) {
|
---|
Replies are listed 'Best First'. | |
---|---|
"Up" is an ill-defined concept
by pbeckingham (Parson) on Apr 05, 2004 at 19:42 UTC | |
Re^2: How to check if a website is up?
by ytjPerl (Scribe) on May 29, 2019 at 16:11 UTC |
In Section
Seekers of Perl Wisdom