Page is a not externally linkable
- Code, Content, and Presentation
-- Perl Server Side CGI Scripting
---- Perl to check if a website is running


sugarkane - 8:44 am on Nov 18, 2003 (gmt 0)


You could use the Net::Telnet module if you want to be sure that the http server is running, rather than just the machine:

#!/usr/bin/perl
use Net::Telnet;
$connection=Net::Telnet->new(Timeout => 5, Host => "www.example.com", Port=>80, Errmode => sub {&error;});

sub error {
print "Connection Failed!\n";
}


Thread source:: http://www.webmasterworld.com/perl/3324.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com