On Thu Oct 20 14:36:32 2011, MIKER wrote:
Show quoted text> On Thu Oct 20 09:37:14 2011, RIBASUSHI wrote:
> > On Thu Oct 20 01:55:57 2011, MIKER wrote:
> > > A good deal of effort went into release 4.00 in June of 2006 to
> > > eliminate the need for Math::BigInt -- It is a nice package but
does not
Show quoted text> > > run on older versions of perl and back then was buggy.
> >
> > I am finding it hard to comprehend the above statement. Could you please
> > explain your logic in terms of corelist:
> >
> > rabbit@Dungeon:~$ corelist -a Math::BigInt
> >
> > Math::BigInt was first released with perl 5
> > 5 undef
> > 5.001 undef
> > 5.002 undef
> > 5.00307 undef
> > 5.004 undef
> > 5.00405 undef
> > 5.005 undef
> > 5.00503 undef
> > 5.00504 undef
> > v5.6.0 undef
> > v5.6.1 0.01
> > v5.6.2 0.01
> > v5.7.3 1.54
> > v5.8.0 1.60
> > v5.8.1 1.66
> > v5.8.2 1.66
> > v5.8.3 1.68
> > v5.8.4 1.70
> > v5.8.5 1.70
> > v5.8.6 1.73
> > v5.8.7 1.77
> > v5.8.8 1.77
> > v5.8.9 1.89
> > v5.9.0 1.66
> > v5.9.1 1.70
> > v5.9.2 1.75
> > v5.9.3 1.77
> > v5.9.4 1.77
> > v5.9.5 1.87
> > v5.10.0 1.88
> > v5.10.1 1.89
> > v5.11.0 1.89_01
> > v5.11.1 1.89_01
> > v5.11.2 1.89_01
> > v5.11.3 1.89_01
> > v5.11.4 1.89_01
> > v5.11.5 1.89_01
> > v5.12.0 1.89_01
> > v5.12.1 1.89_01
> > v5.12.2 1.89_01
> > v5.12.3 1.89_01
> > v5.13.0 1.89_01
> > v5.13.1 1.89_01
> > v5.13.2 1.89_01
> > v5.13.3 1.89_01
> > v5.13.4 1.89_01
> > v5.13.5 1.95
> > v5.13.6 1.97
> > v5.13.7 1.99_01
> > v5.13.8 1.99_02
> > v5.13.9 1.99_03
> > v5.13.10 1.992
> > v5.13.11 1.994
> > v5.14.0 1.994
> > v5.14.1 1.994
> >
> >
>
> The difficulty is/was that Math::BigInt is a C program that did/does not
> compile on many systems including common Linux distro's that are/were
> available at the time -- note the undef's on your list.
The undefs do not signify "does not ship with this perl", it merely
means "before perl 5.6.2 there were *NO* versions on builtin modules".
Math::BigInt is indeed available on any perl since the very ancient 5.0.0.
Show quoted text>
> The test case you show is easily fixed by changing one term and will
> work in all cases.
>
> perl -MNetAddr::IP -E 'say (NetAddr::IP->new("2001::1") eq
> NetAddr::IP->new("2001::3") )'
>
> and if you
> print $ip->numeric(),"\n" you will get the "number" representing the ip
> address as a decimal string to do with as you wish. This is not an issue
> with NetAddr::IP, it is an issue with perl's inability to represent very
> large numbers without the help of something like Math::BigInt.
> NetAddr::IP works whether or not perl can handle the size of the number.
>
> If Math::BigInt is available then one can easily say...
>
> my $num = Math::BigInt->new($ip->numeric);
>
> hmmm... this is not a numeric conversion issue but one of representing
> the object "ip" in the case of NetAddr::IP and "num" in the case of
> Math::BigInt
>
> ---- time passes, 30 minutes or so
>
> I will release version 4.050 shortly that has the method
>
> $ip->bigint which returns a Math::BigInt number
> NetAddr::IP will still not use or require the Math::BigInt to be
> installed but will always return the Math::BigInt representation from
> the method $ip->bigint. NetAddr::IP will also accept Math::BigInt
> numbers to convert to IP addresses. Will take a few days or so.
>
> You made me think about this a bit, thanks.
No, thank you for considering this :) Also note that as per my remark
above you can safely assume that Math::BigInt is *always* available
(unless your goal is to also support perl4).