|
Hi All,
I'm just newbie in using Perl,i tried to use
Net-Ping module.
i download (ActivePerl-5.6.1.632-MSWin32-x86.msi)
on my Windows 2000 server.
and get use PPM to istall Net-Ping
package.
Put when i tried that sample code
use Net::Ping;
$p = Net::Ping->new();
print "$host is alive.\n" if $p->ping($host);
$p->close();
$p = Net::Ping->new("icmp");
foreach $host (@host_array)
{
print "$host is ";
print "NOT " unless $p->ping($host, 2);
print "reachable.\n";
sleep(1);
}
$p->close();
$p = Net::Ping->new("tcp", 2);
while ($stop_time > time())
{
print "$host not reachable ", scalar(localtime()), "\n"
unless $p->ping($host);
sleep(300);
}
undef($p);
# For backward compatibility
print "$host is alive.\n" if pingecho($host);
//////////////////////// and use $host='127.0.0.1'; I doesn't get any output at all. i want to know how to use the moudules ,in the Perl . can any one help me. i will be thatnks for Help. |
