Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Checking ADSL connection

by steveAZ98 (Monk)
on Jul 26, 2000 at 23:23 UTC ( #24553=note: print w/ replies, xml ) Need Help??

in reply to Checking ADSL connection

You could use the Net::Ping package. I'm not sure that this is a more efficent way to do it or not? The module offers many options, so check out the docs. Here's a quick implementation of the code you have above.


#!/usr/bin/perl -w use Net::Ping; my @hosts = ('',''); my $p = Net::Ping->new('icmp') or die "Can't create ping obj: $!"; foreach my $host (@hosts) { if(!$p->ping($host, 2)) { print "$host down, do something\n"; } } $p->close();
Also be careful of your comparison operator, it's == not =, probably a typo, but just wanted to bring it to your attention.

Comment on Re: Checking ADSL connection
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://24553]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2015-11-27 08:20 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (722 votes), past polls