our @hosts = qw /www.yahoo.com www.cpan.org www.perlmonks.org bob.net/; our %host_state = (); #our @alive = `fping -a @hosts`; # 2>/dev/null keeps us from get error messages for fping our @alive = `fping -a @hosts 2> /dev/null`; chomp @alive; for my $host (@alive) { $host_state{$host} = 1; } for my $host (@hosts) { print $host, " is "; print $host_state{$host} ? "alive" : "dead"; print "\n"; }
In reply to Re: Pinging multiple hosts
by gam3
in thread Pinging multiple hosts
by oded_dd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |