sub Is_Host_Alive { my ($host) = @_; my $tmp_syn=Net::Ping->new("syn"); $tmp_syn->ping($host); if(!$tmp_syn->ack){ # print "$host unreachable \n"; $tmp_syn->close; return 0; } $tmp_syn->close; return 1; }