Farly::IPv4::Network - IPv4 network class
This class represents an IPv4 network.
Inherits from Farly::IPv4::Object.
The constructor accepts a dotted decimal format address and mask or CIDR format network.
my $ip_network = Farly::IPv4::Network->new( "10.0.0.0 255.0.0.0" ); my $ip_network = Farly::IPv4::Network->new( "10.0.0.0/8" );
Returns the 32 bit integer network address
$32bit_int_network_addr = $ip_network->address();
Returns the network mask Farly::IPv4:Address object
my $mask_object = $ip_network->inverse_mask()
Returns the bit wise logical not of the 32 bit integer network mask IP address
my $32bit_int_inverse_mask = $ip_network->inverse_mask()
Returns the network address as an Farly::IPv4::Address object
$ipv4_addr_object = $ip_network->network_address();
Returns the broadcast address as an Farly::IPv4::Address object
$ipv4_addr_object = $ip_network->broadcast_address();
$32bit_int_network_addr = $ip_network->first();
Returns the 32 bit integer network broadcast IP address
$32bit_int_network_addr = $ip_network->last();
$ipv4_addr_object = $ip_network->start();
$ipv4_addr_object = $ip_network->end();
Returns the current Farly::IPv4::Network as a dotted decimal format string
print $ip_network->as_string();
Returns the current Farly::IPv4::Network as a dotted decimal format string with a wild card mask
print $ip_network->as_wc_string();
Returns an array containing the current IP network as a Farly::IPv4::Range object.
my @array = $ip->iter();
Farly::IPv4::Network 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.
cpanm
cpanm Farly
CPAN shell
perl -MCPAN -e shell install Farly
For more information on module installation, please visit the detailed CPAN module installation guide.