use Net::IP; my $ip = new Net::IP ('192.168.1.1 - 192.168.254.254') || die; do { print $ip->ip(), "\n"; } while (++$ip);