I have tried this code with no loop at all. The code I posted here is an earlier iteration of some of the attempts I've made.
If you try to ping www.yahoo.com, you will find it does return pings. Why else do you think that I chose to use that site? Common sites such as www.microsoft.com, www.bellsouth.com, and www.cnn.com do not return ICMP pings. Yahoo does. That is not an issue in this case.
I have updated the code I am attempting to use now. It is below. It still will successfully dectect if the remote server is up or down, but it will not post the results when accessed through a website.
$p = Net:ing->new("icmp");
$my_addr = "www.yahoo.com";
$p->bind($my_addr); # Specify source interface of pings
print "<html>", "\n";
print "Server is ";
print "down." unless $p->ping($host, 2);
print "</body> </html>";
It returns working results when run by itself, but not when accessed through IE. Thanks for any help.