Paul W Bennett > Net-IPAddress-Util > Net::IPAddress::Util::Collection

Download:
Net-IPAddress-Util-3.018.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

NAME ^

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

VERSION ^

Version 3.018

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().

syntax highlighting: