in reply to Solution to broken Net::Ping
#!/usr/bin/perl use strict; use warnings; use Net::Ping; my $target = 'www.perlmonks.com'; my $ping = Net::Ping->new("tcp", 2); $ping->{'port_num'} = (getservbyname("http", "tcp") || 80); if ($ping->ping($target)) { print "Yes, I can ping $target\n"; } else { print "No, I cannot ping $target\n"; } $ping->close();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Solution to broken Net::Ping
by Anonymous Monk on Dec 16, 2011 at 09:44 UTC | |
by Generoso (Prior) on Dec 16, 2011 at 21:16 UTC | |
by Anonymous Monk on Dec 16, 2011 at 23:31 UTC | |
by solignis (Initiate) on Dec 17, 2011 at 07:44 UTC |