in reply to Net::Ping duration question

Which version of perl do you have? More specifically, is Time::HiRes part of your core? It should be unless you are on a Commodore64 or something else from my childhood...

If so, this should fix your problem: $p->hires();. Put it right after $p = Net::Ping->new();

Replies are listed 'Best First'.
Re^2: Net::Ping duration question
by Anonymous Monk on Jun 21, 2012 at 06:03 UTC
    That did it, thanks. I got no error so assumed Time:HiRes was there, but didn't see I needed to make that call. All bueno now!
      Perfect! By the way, if you print out $ret, what do you get? I keep getting 0, even though I'm getting realistic duration values. I was under the impression that I'd get $ret == 1 if the host was reachable.