The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::IPAddress::Util::Collection - A collection of Net::IPAddress::Util::Range objects

SYNOPSIS

    use Net::IPAddress::Util::Collection;

    my $collection = Net::IPAddress::Util::Collection->new();

    while (<>) {
        last unless $_;
        push @$collection, $_;
    }

    print join ', ', $collection->tight()->as_ranges();

DESCRIPTION

CLASS METHODS

new

Create a new object.

OBJECT METHODS

sorted

Return a clone of this object, sorted ascendingly by IP address.

compacted

Return a clone of this object, sorted ascendingly by IP address, with adjacent ranges combined together.

tight

Return a clone of this object, compacted and split into tight ranges. See Net::IPAddress::Util::Range for an explanation of "tight" in this context.

as_ranges

Stringification for (x .. y) style ranges.

as_cidrs

Stringification for CIDR-style strings.

as_netmasks

Stringification for Netmask-style strings.

GLOBAL VARIABLES

$Net::IPAddress::Util::Collection::RADIX_THRESHOLD

If set to any defined value (including zero), collections with more than $RADIX_THRESHOLD elements will be sorted using the radix sort algorithm, which can be faster than Perl's native sort for large data sets. The default value is undef().