The output is as follows:use warnings; use strict; use Net::Ping; my @hosts = qw( www.ovidinexile.com www.yahoo.com 127.0.0.1 www.perlmo +nks.org ); my $p = Net::Ping->new(); foreach my $host ( @hosts ) { print "$host\t" . $p->ping( $host ) . "\n"; }
I can successfully ping all of those from the command line. My reading the POD, the holy Cookbook, and several PM posts has failed to enlighten me. Chatterbox commentary has been interesting, but also unenlighting (though I had to run to a meeting after a bit -- maybe I missed something).www.ovidinexile.com 0 www.yahoo.com 0 127.0.0.1 0 www.perlmonks.org 0
Using the icmp ping gives me the following error message:
The tcp ping is unavailable because alarm is not supported on Windows NT (naturally, it doesn't have a decent ping program, either).icmp socket error - Unknown error at C:\WINNT\profiles\cp\desktop\ping +.pl line 6
About the only thing I can think of is to use the system command and parse the response. Yuck! Anyone know what's wrong with my code?
Using WinNT 4.0 with ActiveState Perl 5.6.0.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
In reply to Net::Ping troubles by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |