[lug] Perl and large numbers on (K)ubuntu
gaurav at ggvaidya.com
Fri Sep 23 13:49:50 MDT 2011
On 23 September 2011 11:24, Gary Hodges <Gary.Hodges at noaa.gov> wrote:
> I have some Perl code I have used successfully in the past. It makes
> use of the Date::Manip module. I pass seconds to it for time
> calculations. Yesterday I tried running it on my Kubuntu 10.04 machine,
> and it didn't work. I noticed a small number, say one day or one year,
> of seconds worked, but not on the order of 100 years. With iterative
> trials I found the largest number that works. 2147483647. I did a
> google search on that number, and it turns out it has its own Wikipedia
> page <http://en.wikipedia.org/wiki/2147483647>. That number is of
> course the max value for a 32-bit signed integer.
> I have tested this on another Ubuntu 10.04 install without success. The
> code does work on a Debian lenny machine. I've tried a few things such
> as "use Math::BigInt" and "use bignum", but neither made any difference.
> None of the machines I have run this on are running 64-bit Linux.
> perl -V doesn't yield anything obvious.
Hmm, that is strange. A bit of googling didn't show up any reported
bugs regarding Date::Manip and 32-bit integers. I'd be curious to see
the 'perl -V' output anyway, the version number of Date::Manip you're
using, and - ideally - a small program which demonstrates this bug.
If all else fails, try asking your question at StackOverflow, tagged
'perl': there's quite a lot of people hanging out there answering
More information about the LUG