Ovid has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
(jcwren) Re: Net::Ping troubles
by jcwren (Prior) on Nov 21, 2000 at 04:35 UTC | |
(tye)Re: Net::Ping troubles
by tye (Sage) on Nov 21, 2000 at 04:38 UTC | |
(Ovid) Re: Net::Ping troubles
by Ovid (Cardinal) on Nov 21, 2000 at 04:55 UTC | |
Re: Net::Ping troubles
by little (Curate) on Nov 21, 2000 at 04:37 UTC | |
by Fastolfe (Vicar) on Nov 21, 2000 at 04:39 UTC | |
by little (Curate) on Nov 21, 2000 at 04:44 UTC | |
Re: Net::Ping troubles
by Fastolfe (Vicar) on Nov 21, 2000 at 04:35 UTC |