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."



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to