in reply to net:ping problem
#!/usr/bin/perl use strict; use warnings; use Net::Ping; #tcp dosn't require root privileges my $p = Net::Ping->new('tcp'); $p->tcp_service_check(1); my $host = "192.168.0.1"; my $port = 80; $p->{'port_num'} = $port; print "The service on $host port $port is ", ($p->ping($host) ? "up" : "down"), ".\n";
|
|---|