pinging the network from perl

From: Spalding, Stephen <SSpaldin_at_mem-ins.com>
Date: Tue, 09 Feb 1999 14:15:07 -0600

Hello all.

I'm trying to use perl's pingecho command to see if a member of the network
is present in a perl script, and it's not working. I'm using the example
right out of the O'Reilly perl programming book, but it still won't work.
Here is what I'm trying:

use Net::Ping;

$host_name = 'mem2';
$timeout = 10;

print "mem2 is on the network\n" if pingecho($host_name, $timeout);


I've tried varying the structure of the last line, and I've tried varying
how the arguments are displayed in the pingecho statement (adding different
quote marks and putting in actual values instead of variables).

When I run the above lines, the program comes back immediately and does not
even wait for the 10 second timeout. Can anyone see what I'm doing wrong?

Thanks!

-StephenS



Stephen Spalding
Associate System Administrator
Missouri Employers Mutual Insurance
sspaldin_at_mem-ins.com
1000 West Nifong
Columbia, MO 65203
(573) 499 - 4230
(800) 442 - 0590
fax (573) 499 - 4310
Received on Tue Feb 09 1999 - 20:17:39 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:39 NZDT