Farly::IPv4::Range - IPv4 range class
This class represents an IPv4 address range.
Inherits from Farly::IPv4::Object.
The constructor accepts a dotted decimal format, or 32 bit integer format, IP address range with the first address separated from the last address by a space or dash.
my $ip_range = Farly::IPv4::Range->new( "10.0.0.1 10.0.0.25" );
my $ip_range = Farly::IPv4::Range->new( "10.0.0.1-10.0.0.25" );
Returns the first address in the range as a 32 bit integer
$first_32bit_int_addr = $ip_range->first();
Returns the last address in the range as a 32 bit integer
$last_32bit_int_addr = $ip_range->last();
Returns the first address as an Farly::IPv4::Address object
$ipv4_addr_object = $ip_range->start();
Returns the last address as an Farly::IPv4::Address object
$ipv4_addr_object = $ip_range->end();
Returns the current Farly::IPv4::Range as a dotted decimal format string
Return an ARRAY of Farly::IPv4::Network objects containing exactly the same IP addresses as the current range.
my @array = $ip_range->as_network();
Returns true if the other Farly::IPv4::Object's first address immediately follows the current range's last address.
$ip_range->adjacent( $other_ipv4_object );
Returns an array containing the current Farly::IPv4::Range object.
my @array = $ip_range->iter();
Farly::IPv4::Range Copyright (C) 2012 Trystan Johnson
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
To install Farly, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.