use Net::CIDR::Lite; my $cidr = Net::CIDR::Lite->new( '192.168.0.0-192.168.1.15' ); print "$_\n" for $cidr->list();