Greetings all,
I find that my Net::Ping (Which is reported to be the (latest release) just doesn't seem to work.
There was a thread about this a while back, but there was no real solution - so I'm hoping to further the line;
I run Linux 2.2.6 (Slackware) w/5.005_03.
The examples state that you can just pass it a hostname (the Perl Cookbook uses "kingkong.com") which perl responds with:
Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16 at /usr/lib/perl5/i386-linux/Socket.pm line 295.
I figure that its expected a packed address, but when I feed it something like (And yes, i'm running as root):
$p = Net::Ping->new('icmp');
print "She's workin" if $p->ping(inet_aton("addr.com"));
$p->close();
The script takes 1/4 of a second to complete, making me very suspicious as to whether anything is happened at all!
Increasing the timeout does nothing, and the command still runs for 1/4 of a second.
Anyone faced and overcome this?
JP
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.