#!/usr/bin/perl -l use strict; use warnings; use Net::Ping; my @net=map "192.168.$_", qw/97 100 102 104 105 32 33 34/; my $p=Net::Ping->new or die "Can't create ping object: $!\n"; for my $net (@net) { for (16..250) { my $host="$net.$_"; warn "$host not responding!\n" and next if !$p->ping($host); print $host; } } __END__