in reply to Re: How to use "$ssh->before()"
in thread How to use "$ssh->before()"
or, alternately (because using icmp may require addtl info)...
#! /usr/bin/perl -w use 5.018; # cf [id://1123481] -> my $p = Net::Ping->new("icmp"); # method not allowed by (some) hosts, YMMV! my @host_array = ('n+.n+.n+.n+', 'n+.n+.n+.n+', .... ); say "\n Pinging so-and-so(s)\n"; use Net::Ping; my $p = Net::Ping->new("syn"); for my $host (@host_array) { if ($p->ping($host) ) { say "Host $host is alive \n (at least, 'arguably' See doc re +'syn' protocol)\n"; } else { say "Could not ping host $host, $!"; } $p->close(); }
|
|---|