diff --git a/Changes b/Changes index 234d1ba..357a5b5 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ Revision history for Perl extension NetAddr::IP +4.052 Tue Oct 25 16:18:38 PDT 2011 + add test in Lite.pm v1.35 for api-version of Math::BigInt to + support versions earlier than 1.70, circa Dec 2003. + Thanks to Paul Howarth for spotting that bug. + 4.051 Mon Oct 24 14:44:53 PDT 2011 fix bug 71869 in Lite.pm v1.34 diff --git a/IP.pm b/IP.pm index 702b1ad..ae3a8bf 100644 --- a/IP.pm +++ b/IP.pm @@ -35,7 +35,7 @@ @ISA = qw(Exporter NetAddr::IP::Lite); -$VERSION = do { sprintf " %d.%03d", (q$Revision: 4.51 $ =~ /\d+/g) }; +$VERSION = do { sprintf " %d.%03d", (q$Revision: 4.52 $ =~ /\d+/g) }; =pod diff --git a/Lite/Changes b/Lite/Changes index 76b01e3..148b232 100644 --- a/Lite/Changes +++ b/Lite/Changes @@ -1,8 +1,14 @@ Revision history for Perl extension NetAddr::IP::Lite +1.35 Tue Oct 25 16:18:38 PDT 2011 + add test for api-version of Math::BigInt to support versions + earlier than 1.70, circa Dec 2003. + Thanks to Paul Howarth for spotting that bug. + 1.34 Mon Oct 24 14:38:16 PDT 2011 use Math::BigInt::Calc for creating BigInt values and fall back to NetAddr::IP::Calc if Math::BigInt is not present. + Thanks to Paul Howarth for spotting that bug. remove reference to Config{osname} in InetBase.pm v0.03 (Util 1.43) diff --git a/Lite/Lite.pm b/Lite/Lite.pm index f0f31e6..2ba073e 100644 --- a/Lite/Lite.pm +++ b/Lite/Lite.pm @@ -32,7 +32,7 @@ use vars qw(@ISA @EXPORT_OK $VERSION $Accept_Binary_IP $Old_nth $AUTOLOAD *Zero); -$VERSION = do { my @r = (q$Revision: 1.34 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +$VERSION = do { my @r = (q$Revision: 1.35 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; require Exporter; @@ -1181,21 +1181,28 @@ =cut my $biloaded; +my $biapi; sub _biValue { unless ($biloaded) { if (eval {require Math::BigInt::Calc}) { $biloaded = \&Math::BigInt::Calc::_new; + $biapi = eval {Math::BigInt::Calc::api_version()}; } else { require NetAddr::IP::Calc; $biloaded = \&NetAddr::IP::Calc::_new; + $biapi = 1; } } - my $bi = { + + my $biarray = $biapi + ? $biloaded->(undef,$_[0]) + : $biloaded->(undef,\$_[0]); # versions before 1.70 expect a reference + + bless { sign => '+', - value => $biloaded->(undef,$_[0]), - }; - bless $bi, 'Math::BigInt'; + value => $biarray, + }, 'Math::BigInt'; } sub bigint($) { diff --git a/META.yml b/META.yml index fd06cc8..a03c3c6 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: NetAddr-IP -version: 4.051 +version: 4.052 abstract: Manages IPv4 and IPv6 addresses and subnets license: ~ author: