http://qs1969.pair.com?node_id=448069

perlknight has asked for the wisdom of the Perl Monks concerning the following question:

All, below is a code snipet from the doc of net ping. AFAIK, this is suppose to test if www port is open (listening).
$p = Net::Ping->new("tcp", 2); # Try connecting to the www port instead of the echo port $p->{port_num} = getservbyname("http", "tcp"); #while ($stop_time > time()) #{ print "$host not reachable ", scalar(localtime()), "\n" unless $p->ping($host); sleep(300); #} undef($p);
I tried using this, but it seems to fail. I changed "www" to ssh and telnet. I ran it on a host that should have failed. Anyone knows what this did not fail?