I don't think that will work, for example consider something like ($value << 6) + length($value). So if the first part overflows in JS then it is necessary to overflow (the first part) in Perl too. Simulating the overflow for the sum would not do. At the moment I am running JS code via shelling out to node.js and that works just fine.
I was hoping that there would be a module like Math::BigInt where you specify the number of bits or something like use smallint; But now, come to think of it, perhaps a new module could consist of only overloading arithmetic operators. Let me see if I can whip up something based on your pack receipe.
Edit: see Re: Trying to translate overflowing JS code to Perl with working code for this.
In reply to Re^4: Trying to translate overflowing JS code to Perl
by bliako
in thread Trying to translate overflowing JS code to Perl
by bliako
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |