That might let even vec() work since Perl's "32 bit" type might end up being 64 bits anyway.Seems the I32 type will still be 32 bits even if the int is 64 bits. (
almut mentioned this earlier in this thread - though, admittedly, I don't know if it's actually *proven* to be so.)
I suppose the obvious fix here is to split your data into chunks and make access a two step processYes, I think that should work. In this particular case it would be necessary to increase the chunk size to 2 only.
The OP's problem could also be handled with Math::GMP or Math::GMPz, since the GMP library measures the bit position with an unsigned long - thus allowing a max bit position value of 2 ** 32 - 1 (for 32-bit longs). The tricky bit there is in getting the string into the GMP object without doubling the memory requirement of the program. The GMP library does have functions that allow read/write directly from/to file - thus, I assume, avoiding that "doubling up" problem. Math::GMP doesn't provide access to those functions but Math::GMPz-0.26 does (in the form of
Rmpz_out_raw and
Rmpz_inp_raw).
Note: I'm not actually recommending that Math::GMPz-0.26 (which I submitted to CPAN just last night) be the solution that the OP ought to adopt. I'm just pointing out that it could be used. (Earlier versions of Math::GMPz don't provide
Rmpz_out_raw and
Rmpz_inp_raw .... due to oversight :-)
Cheers,
Rob
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.