[rochester-pm-list] Net::Ping

Shawn Porter sporter at rit.net
Thu Feb 4 16:33:37 CST 1999


Has anybody else ever used Net::Ping.  I was using it the other day and it
wasn't working according to its documentation.

Here's a snippet:

	use Net::Ping;
	my $p = Net::Ping->new(tcp, 50);
	my $resp = $p->ping($hostname);

When I do this, I get a '0' in $resp if I can contact the host and a ''
(null) if I can't contact the host.  (Changing the timeout doesn't affect
it.)  According to the docs, I should get a '1' if it is reachable, a '0'
if it is not, and '' (null) if "the hostname cannot be found or there is a
problem with the IP number."  No matter what I do, it never returns a '1'.

(Perl 5.004_04 tested on Linux 2.0.36 and Digital OSF1 V4.0.)

Any ideas?

--
Shawn Porter
http://www.rit.net/sporter
sporter at rit.net





More information about the Rochester-pm mailing list