I can't give you the answer, but I can rule out an attractive possibility for you.

I tried to wrap the call to $p->ping($host) with some benchmarking by Time::HiRes.

For example,

use Net::Ping; use Time::HiRes qw( usleep ualarm gettimeofday tv_interval ); my $p = new Net::Ping; my $t0 = [gettimeofday]; $p->ping('www.yahoo.com'); print "Elapsed time: ", tv_interval ( $t0, [gettimeofday]), "\n";
Unfortunately, the times I got back were not consistent with the ping user call:
[bogus@www bin]$ ping -c 1 www.yahoo.com PING www.yahoo.akadns.net (216.32.74.50) from 216.90.131.2 : 56(84) by +tes of data. 64 bytes from www1.dcx.yahoo.com (216.32.74.50): icmp_seq=0 ttl=242 ti +me=290.891 msec --- www.yahoo.akadns.net ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max/mdev = 290.891/290.891/290.891/0.000 ms [bogus@www bin]$ ./ping-test.pl Elapsed time: 5.04157 [bogus@www bin]$ ping -c 1 www.yahoo.com PING www.yahoo.akadns.net (216.32.74.52) from 216.90.131.2 : 56(84) by +tes of data. 64 bytes from www3.dcx.yahoo.com (216.32.74.52): icmp_seq=0 ttl=242 ti +me=94.607 msec --- www.yahoo.akadns.net ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max/mdev = 94.607/94.607/94.607/0.000 ms [olsonco@www bin]$ ./ping-test.pl Elapsed time: 5.037361 [bogus@www bin]$ ping -c 1 www.yahoo.com PING www.yahoo.akadns.net (64.58.76.178) from 216.90.131.2 : 56(84) by +tes of data. 64 bytes from www9.dcx.yahoo.com (64.58.76.178): icmp_seq=0 ttl=242 ti +me=101.953 msec --- www.yahoo.akadns.net ping statistics --- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max/mdev = 101.953/101.953/101.953/0.000 ms [bogus@www bin]$
It doesn't appear in the perldocs of Net::Ping that it is sending multiple packets, so I'm somewhat mystified where the time difference comes in.

2001-04-19 Edit by Corion : Added CODE tags


In reply to Re: Net::Ping -- other output formats? by Starky
in thread Net::Ping -- other output formats? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.