FWIW, I tried your 3 methods, and all 3 give me the same result on the 172.16.1.2 ip: "does not ping".
Other observation:
$p->close(); is never executed because you always return from the sub before you reach that line. From the Net::Ping docs, you don't even need to close when your code is inside a sub.
If you actually try an ip that does ping on your network, it still comes back with "does not ping."
I will remove the close and also try the qq.
Thanks!
My point was that I cannot reproduce your inconsistent results. Your 3 methods return "does not ping" on an ip that I can't access, and they all return "pings" on an ip that I can access.
By the way, qw vs. qq will make no difference in this case; I'm not sure why the other monk recommended that change.