#!/usr/bin/perl use strict; use warnings; use diagnostics; use Net::Ping; my $i; my $host; my $p = Net::Ping->new("syn"); $p -> bind("10.90.1.27"); for( $i = 0; $i <= 254; $i++) { $host = "10.90.1.$i"; $p -> ping("$host", 2); print("$host\n") if pingecho($host); }