use strict; use Net::Ping; $|++; my $net = '194.153.145.'; my @hosts = 1..254; $_ = $net.$_ for @hosts; my $p = Net::Ping->new("icmp"); $p->{'timeout'} = 0.003; for (@hosts) { print "$_ is "; print "NOT " unless $p->ping($_); print "reachable.\n"; } print time - $^T