Re: Script Required to Check a range of IP's
- From: rvtol+news@xxxxxxxxxxxx (Dr.Ruud)
- Date: Thu, 29 Jun 2006 21:30:58 +0200
Prabu schreef:
open(FILE,"$file_name") || die "Not been Accessed" ;
open my $fh, '<', $file_name or die "open $file_name: $!" ;
if($p->ping($host, 2))
{
chomp($host);
print "$host is alive.\n";
}
else
{
chomp($host);
print "$host not reachable.\n";
}
sleep(1);
You are calling ping() with an un-comp-ed $host.
chompt $host ;
print $p->ping($host, 2)
? "$host is alive.\n"
: "$host not reachable.\n" ;
sleep(1) ;
Further reading: perldoc Net::Ping
(like about tcp/udp/icmp).
--
Affijn, Ruud
"Gewoon is een tijger."
.
- Follow-Ups:
- Re: Script Required to Check a range of IP's
- From: Dr.Ruud
- Re: Script Required to Check a range of IP's
- References:
- Script Required to Check a range of IP's
- From: Mazhar
- Re: Script Required to Check a range of IP's
- From: Prabu
- Script Required to Check a range of IP's
- Prev by Date: Re: Script Required to Check a range of IP's
- Next by Date: RE: Script Required to Check a range of IP's
- Previous by thread: Re: Script Required to Check a range of IP's
- Next by thread: Re: Script Required to Check a range of IP's
- Index(es):