Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Using Net::Ping

by Rhose (Priest)
on Sep 25, 2001 at 18:47 UTC ( #114548=note: print w/replies, xml ) Need Help??


in reply to Re: PING taking too long
in thread PING taking too long

I would also try the Net::Ping module and use a defined timeout. Here is an example.

use strict; use Net::Ping; use constant TIMEOUT => 1; my $mNetPing = Net::Ping->new('icmp',TIMEOUT); foreach ('host1', 'host2', '172.20.41.152') { print $_,($mNetPing->ping($_) ? ' is alive' : ' is not alive'),"\n"; } $mNetPing->close();

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2019-08-18 19:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?






    Results (135 votes). Check out past polls.

    Notices?