[BNE-PM] Socket Error Anyone help with this one ?

Andrew Wild andrew at intervations.com.au
Thu Aug 5 21:23:02 CDT 1999


I tried it out under Perl 5.005_03 and got the same error... 

It appears to have something to do with the ping defaulting to udp. If you force it to use icmp as the protocol, it appears to work....

I wrote a quick version of it specifying icmp as the protocol and giving it a timeout value and it appeared to work:

#!/usr/local/bin/perl

use Net::Ping;

$host = 'localhost';

$p = Net::Ping->new('icmp',1);

print $p->ping($host) ? "Alive" : "Not alive";

$p->close();

Cheers, Andrew.




More information about the Brisbane-pm mailing list