1. Perl
  2. Module
  3. here

Net::Ping::External - Execute the ping command in an OS - independent way

The Net::Ping::External module is a module for executing ping commands in an OS-independent way.

# Loading modules and importing functions
use Net::Ping::External 'ping';

Use the ping function to execute the ping command. In addition to the host name (domain name), you can also specify an IP address for host.

# Execute ping command
my $alive = ping (host =>'localhost');

You can also specify a timeout value (seconds).

# Specify timeout value
my $alive = ping (host =>'localhost', timeout => 3);

FAQ about Net::Ping::External

Q. What are the benefits of the Net::Ping::External Net::Ping module?

A. If you specify icmp as the new argument of the Net::Ping module, you can check the existence of the remote host using ICMP in the same way as the ping command. However, this requires root privileges. If this feels inconvenient, you may want to use the Net::Ping::External module.

Related Informatrion