use strict; use warnings; use Net::Netmask; while (<>) { chomp; s/;/:/; my $block = new Net::Netmask($_); if (not $block) { warn "Bad CIDR specification"; next; } my @ip = $block->enumerate(); # Remove the network and gateway addresses. shift(@ip); shift(@ip); # Remove the broadcast address. pop(@ip); for my $ip (@ip) { print $ip, "\n"; } }