ZipTie::Addressing::Subnet
use ZipTie::Addressing::Subnet;
my $host = '192.168.1.50'; # doesn't need to be the network address
my $mask = 24;
my $subnet = ZipTie::Addressing::Subnet->new($host, $bitMask);
if ($subnet->contains('192.168.1.33'))
{
print 'Yes, this would be the case';
}
Build a subnet definition, IPv4 or IPv6 based on any host address in the subnet, and a subnet mask in bits.
Requires Net::IP to function.
new($host, $bitMask)
to_string()contains($host)
The contents of this file are subject to the AlterPoint Open Technology License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://inventory.alterpoint.com/license
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
Contributor(s): rkruse Date: Jul 23, 2008