Hello All,
I have a below piece of code:
$tempVar = hex(get_data());
$test |= $tempVar << (64 - $shiftby * ($size - $iteration - 1));
This code is to be executed on perl 5.26. Currently it is executing on 5.16.
When i try to execute this on 5.26, it gives random results (Mostly 0 everytime). It works fine on 5.16.
I needed some help on how to handle this on 5.26. Basically the below equation should be modified to run on both 5.16 and 5.26:
$test |= $tempVar << (64 - $shiftby * ($size - $iteration - 1));
Any help/guidance would be appreciated.
Thanks
What I have tried:
I tried the below:
1) Went through the perl config operations which are used to build perl 5.26 and perl 5.16.
2) Perl 5.26 is built with "
Quote:
-Duse64bitint
". I think due to this it explicitly treats all variables as 64 bits. However Perl 5.16 is not built with this.
3) I am trying to build perl 5.26 without this flag. But this will be cumbersome as we might move to some other version in near future. I am not sure if this is the right approach.
4) Finding alternative of this for example:
$tempVar |= $tempVar << (64 - $shiftby * ($size - $iteration - 1))
$test |= $tempVar
This however gives some defined value but with some delta.