[EMAIL PROTECTED] (Oliver Enzmann) wrote in message news:<[EMAIL PROTECTED]>...
> Daniel Hartmeier wrote:

> > There probably is some tool that calculates the least number of blocks
> > that represent an arbitrary range, but I can't remember. Another reader
> > might :)
> 
> I use the Net::CIDR Perl module:
> 

Net::CIDR seems to have a problem with duplicate/overlapping
ranges, and also is slow for large numbers of ranges (which
may not be the case in this particular instance, but just
in case you run into that problem...). So here's an equivalent
Net::CIDR::Lite solution (not tested):

print "$_\n" for
 Net::CIDR::Lite->new(
  "10.0.0.210 - 10.0.0.235",
  "10.1.2.0   - 10.2.3.128",
)->list;

HTH,
Douglas Wilson

Reply via email to