<UPDATE> On further fiddling about, I now don't think there's much in what I've written below that actually holds much water.
I think it might be 5.38.2's insistence on loading Math::BigInt::Calc that's causing the problem with the one-liners I provided.
If I use Math::Complex instead of Math::BigInt, everything works fine.
I'll leave this post as is, in case there's something here that triggers something useful.
</UPDATE>
Your perl-5.16.2 will be a 32-bit build; I presume your 5.38.2 is a 64-bit build (though StrawberryPerl did also provide a 32-bit build of 5.38.2).
I have both AP-5.16.2 and (64-bit) SP-5.38.2 on this Windows 11 box.
Using 5.38.2:
D:\pscrpt\storable>perl -MMath::BigInt -MStorable -Mwarnings -le "$mbi
+ = Math::BigInt->new(12345); Storable::nstore(\$mbi, 'file.s'); $ret
+= Storable::retrieve('file.s'); print $$ret; print ref($$ret);"
12345
Math::BigInt
Then, in another shell, using 5.16.2:
D:\pscrpt\storable>perl -MMath::BigInt::Calc -MMath::BigInt -MStorable
+ -Mwarnings -le "$ret = Storable::retrieve('file.s'); print $$ret; pr
+int ref($$ret);"
Cannot restore overloading on ARRAY(0x23df904) (package Math::BigInt::
+Calc) (even after a "require Math::BigInt::Calc;") at C:/_32/ap1600/l
+ib/Storable.pm line 380, at -e line 1.
However, reading the OP, it seems that it's the other way around ... the file is being created by 5.16.2 and read by 5.38.2.
And that works fine for me.
Using 5.16.2
D:\pscrpt\storable>del file.s
D:\pscrpt\storable>perl -MMath::BigInt -MStorable -Mwarnings -le "$mbi
+ = Math::BigInt->new(12345); Storable::nstore(\$mbi, 'file.s'); $ret
+= Storable::retrieve('file.s'); print $$ret; print ref($$ret);"
12345
Math::BigInt
Using 5.38.2:
D:\pscrpt\storable>perl -MMath::BigInt -MStorable -Mwarnings -le "$ret
+ = Storable::retrieve('file.s'); print $$ret; print ref($$ret);"
12345
Math::BigInt
I tried using store instead of nstore, but then both of those examples fail to retrieve(), reporting:
Byte order is not compatible at .... , at -e line 1.
In my case, I think it's the problem of a 32-bit architecture not handling 64-bit stuff.
But if you're doing it the other way about, then I don't know. (My second example seems to confirm my belief that the 64-bit architecture will handle 32-bit stuff.)
Cheers, Rob
|