in reply to Net::Ping:External
And received the following output:#!C:\perl\bin\perl use strict; use warnings; use Net::Ping::External qw(ping); print ping(host=>"yahoo.com"), " | ", ping(host=>"wayfakehostname.com" +);
On my system ping() is returning 0 for both valid and invalid hostnames (unless it didn't correctly perform the ping, I haven't checked the internals yet), which is why nothing is printing out when I run your code, either. Try playing around with the module a bit more, perhaps your output is similar (and/or perhaps you're using ActivePerl and their port is broken).C:\Documents and Settings\marc>perl test.pl 0 | 0
to this:return 1 if $result =~ /time?\d*ms/; return 0;
and now it works fine for me. I should probably email the author with that bugfix, perhaps it only is affected in 2k, but I suspect not, the time? will positively match, then because he's missing the '=', the rest fails. I can't imagine that 98's ping prints 'time49ms'.return $result =~ /time=\d+ms/?1:0;
|
|---|