$ sudo prove -v 5.ping3.pl [sudo] password for bob: 5.ping3.pl .. 1..2 ok 1 - System ping to www.google.com not ok 2 - Net::Ping to www.google.com # Failed test 'Net::Ping to www.google.com' # at 5.ping3.pl line 14. # Looks like you failed 1 test of 2. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/2 subtests Test Summary Report ------------------- 5.ping3.pl (Wstat: 256 Tests: 2 Failed: 1) Failed test: 2 Non-zero exit status: 1 Files=1, Tests=2, 11 wallclock secs ( 0.04 usr 0.02 sys + 0.14 cusr 0.03 csys = 0.23 CPU) Result: FAIL $ cat 5.ping3.pl #!/usr/bin/perl -w use 5.011; use Net::Ping; use Test::More tests => 2; my $dest = 'www.google.com'; my $pinger = Net::Ping->new ('icmp', 10); my $res; $res = system ("ping -nqc1 -w 3 -W 3 $dest > /tmp/ping.log"); is ($res, 0E0, "System ping to $dest"); $res = $pinger->ping ($dest); ok ($res, "Net::Ping to $dest"); $pinger->close; $ ping -nqc1 -w 3 -W 3 www.google.com PING www.google.com(2607:f8b0:400a:800::2004) 56 data bytes --- www.google.com ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 24.338/24.338/24.338/0.000 ms $