Import of MIKER/NetAddr-IP-4.041 from CPAN.
gitpan-cpan-distribution: NetAddr-IP
gitpan-cpan-version:      4.041
gitpan-cpan-path:         MIKER/NetAddr-IP-4.041.tar.gz
gitpan-cpan-author:       MIKER
gitpan-cpan-maturity:     released
1 parent ca437b8 commit 1c21d90a989d50cc52ae7639a79c54fba2c820d9
@Michael Robinton Michael Robinton authored on 9 Mar 2011
Gitpan committed on 21 Oct 2014
Showing 8 changed files
View
6
Changes
Revision history for Perl extension NetAddr::IP
 
4.041 Tue Mar 8 15:18:16 PST 2011
Updated Lite.pm v1.26, "sub num" to support usable IP ranges
greater than 2**32
 
Thanks to Jan Ploski jan@plosquare.com for finding this bug
 
4.040 Sat Feb 19 10:04:00 PST 2011
correction to use of Util.pm package lexicals
 
View
32
IP.pm
package NetAddr::IP;
 
use strict;
#use diagnostics;
use NetAddr::IP::Lite 1.25 qw(Zero Zeros Ones V4mask V4net);
use NetAddr::IP::Lite 1.26 qw(Zero Zeros Ones V4mask V4net);
use NetAddr::IP::Util 1.36 qw(
sub128
inet_aton
inet_any2n
@EXPORT_FAIL = qw($_netlimit);
 
@ISA = qw(Exporter NetAddr::IP::Lite);
 
$VERSION = do { sprintf " %d.%03d", (q$Revision: 4.40 $ =~ /\d+/g) };
$VERSION = do { sprintf " %d.%03d", (q$Revision: 4.41 $ =~ /\d+/g) };
 
=pod
 
=head1 NAME
 
=item C<-E<gt>num()>
 
Version 4.00 of NetAddr::IP and version 1.00 of NetAddr::IP::Lite
Returns the number of usable addresses IP addresses within the
subnet, not counting the broadcast or network address. Previous versions
returned th number of IP addresses not counting the broadcast address.
return the number of usable IP addresses within the subnet,
not counting the broadcast or network address.
 
Previous versions worked only for ipV4 addresses, returned a
maximum span of 2**32 and returned the number of IP addresses
not counting the broadcast address.
(one greater than the new behavior)
 
To use the old behavior for C<-E<gt>nth($index)> and C<-E<gt>num()>:
 
use NetAddr::IP::Lite qw(:old_nth);
 
WARNING:
 
NetAddr::IP will calculate and return a numeric string for network
ranges as large as 2**128. These values are TEXT strings and perl
can treat them as integers for numeric calculations.
 
Perl on 32 bit platforms only handles integer numbers up to 2**32
and on 64 bit platforms to 2**64.
 
If you wish to manipulate numeric strings returned by NetAddr::IP
that are larger than 2**32 or 2**64, respectively, you must load
additional modules such as Math::BigInt, bignum or some similar
package to do the integer math.
 
=item C<-E<gt>re()>
 
Returns a Perl regular expression that will match an IP address within
View
Lite/Changes
View
Lite/Lite.pm
View
Lite/README
View
Lite/t/v6-num.t 0 → 100644
View
MANIFEST
View
META.yml