http://qs321.pair.com?node_id=359724


in reply to Re: Re: My ping should fail but does not
in thread My ping should fail but does not

Ok, pingecho() is a deprecated back-compat wrapper for the ping method of Net::Ping. Running perldoc -m Net::Ping shows that ping returns an empty list if no $host is given. The default I mentioned was pure speculation. I don't see any way that an empty host string will return true, unless your inet_aton does so for empty argument.

Try distinguishing between undef and 0 as return values for pingecho. It is supposed to return undef for an unresolved host and 0 for an unreachable one. That will help you diagnose the problem.

How about just skipping the ping if the host string is not true?

if ($host) { if (pingecho($host,$timeout)) { #... } }

After Compline,
Zaxo