Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Using Ping with perl

by NetWallah (Abbot)
on Apr 01, 2014 at 14:43 UTC ( #1080581=note: print w/ replies, xml ) Need Help??


in reply to Using Ping with perl

Here are the basics of Net::Ping (Pieces extracted from old code):

# Assumes $host is set to what you want to ping my $p = Net::Ping->new("icmp",$TimeOut,,,$ttl); $p->hires(1);#use Time::HiRes module, allowing milliseconds to be +returned by subsequent calls to ping(). my ($ret, $duration, $ip) = $p->ping($host); if ($ret){ $verbose and printf("$host [ip: $ip] is alive (%.2f ms)\n" +, 1000 * $duration); } $p->close();

        What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
              -Larry Wall, 1992


Comment on Re: Using Ping with perl
Download Code
Re^2: Using Ping with perl
by thargas (Chaplain) on Apr 03, 2014 at 11:01 UTC
    If you want to simulate traceroute, have you tried looking how it's done in Net::Traceroute::PurePerl. Unfortunately, it's not as straightforward as your code hopes.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2014-08-02 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (53 votes), past polls