Provides methods to create ping objects and test the reachability of remote hosts on the network. After the object has been created, a variable number of hosts can be pinged multiple times before closing the connection. The methods are the following.
$p = Net::Ping->new([proto[, def_timeout[, bytes]]])
Creates a new ping object. All arguments are optional. Takes the following arguments:
Closes network connection for this ping object. The connection can also be closed by undef $p and is automatically closed if the ping object goes out of scope.
Pings remote host and waits for a response. Takes the following arguments:
If host cannot be found, or if there is a problem with the IP number, returns undef. Otherwise, returns 1 if the host is reachable and 0 if it is not.
pingecho (host[, timeout])
Provides backward compatibility with the previous version of Net::Ping. Uses the tcp protocol, with return values and parameters the same as described for ping.
Copyright © 2002 O'Reilly & Associates. All rights reserved.