`I am trying to use unpack logic of perl in unix and Linux, But see it sa huge diffrence when I iterate all the input binary string , Not sure how to solve the issue ??? or is platform related ???
$binaryString = “^@^@^@^@”
so my code logiin Unix
$intval = unpack(“i*”, $binaryString);
This returns 0 which is expected.
whenI run the same in Linux its give large valueIn order to fix this issue I read only the last bytes
unpack(“i*”, substr($binaryString,3,1)
it return 0 as expected
but if the Binry String contain sthe value
$BinaryString = “^@^@<89><9d>”
Unix return 35229 but Linux its return only 157 as I am reading the last character…But I want the same value 35229 in Linux ???`
$binaryString = “^@^@^@^@”
so my code logiin Unix
$intval = unpack(“i*”, $binaryString);
This returns 0 which is expected.
whenI run the same in Linux its give large valueIn order to fix this issue I read only the last bytes
unpack(“i*”, substr($binaryString,3,1)
it return 0 as expected
but if the Binry String contain sthe value
$BinaryString = “^@^@<89><9d>”
Unix return 35229 but Linux its return only 157 as I am reading the last character…But I want the same value 35229 in Linux ???`