Subject: | Problem with OLE-Storage_Lite-0.16 |
Date: | Mon, 31 Mar 2008 11:11:26 +0100 |
To: | bug-OLE-Storage_Lite [...] rt.cpan.org |
From: | Andrew Benham <andrew.benham [...] thus.net> |
I've found a problem with OLE-Storage_Lite v0.16 when used with
Math::BigInt v1.77 on Perl 5.6.1
Lines in OLE/Storage_Lite.pm state:
1327 my $iHSec = $iBigDt % 10000000;
1328 $iBigDt /= 10000000;
1329 my $iBigDay = int($iBigDt / (24*3600)) + 1;
1330 if ($iBigDay->numify eq $iBigDay) {
1331 $iBigDay = $iBigDay->numify;
1332 }
1333 my $iTime = int($iBigDt % (24*3600));
1334 if ($iTime->numify eq $iTime) {
1335 $iTime = $iTime->numify;
1336 }
This code works fine on Perl 5.8.8 - variables $iBigDay and $iTime
are created as Math::BigInt objects.
However on Perl 5.6.1 variables $iBigDay and $iTime are created as
integers, and then the calls to the numify method blow up with
"""Can't call method "numify" without a package or object reference"""
I can fix the problem by removing the 'int()' cast in two places - then
variables $iBigDay and $iTime are created as Math::BigInt objects on
both Perl 5.6.1 and 5.8.8
I haven't done exhaustive testing though to prove the results are always
the same. Perhaps using the bfloor method would be a better idea ?
I don't know if a later Math::BigInt would help, but 1.80 onwards need
Perl 5.6.2 as a minimum.
--
Andrew Benham Demon@Thus andrew.benham@thus.net
Finchley, London N3 2QQ, U.K. Tel: 020 8495 6343 Fax: 020 8495 6037