in reply to Solution to broken Net::Ping
#!/usr/bin/perl use strict; use warnings; use Net::Ping; my $target = 'perlmonks.org'; my $ping_obj = Net::Ping->new(); print "Net::Ping version is $Net::Ping::VERSION\n"; if ($ping_obj->ping($target)) { print "Yes, I can ping $target\n"; } else { print "No, I cannot ping $target\n"; }
Prints:
Net::Ping version is 2.36 Yes, I can ping perlmonks.org
for me. Are you sure your target is reachable?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Solution to broken Net::Ping
by solignis (Initiate) on Dec 16, 2011 at 08:21 UTC | |
|
Re^2: Solution to broken Net::Ping
by solignis (Initiate) on Dec 16, 2011 at 08:26 UTC | |
by GrandFather (Saint) on Dec 16, 2011 at 08:57 UTC | |
by solignis (Initiate) on Dec 16, 2011 at 09:23 UTC |