|
|
| "be consistent" | |
| PerlMonks |
Re^2: converting artibrary binary data to numeric valuesby markle (Initiate) |
| on Oct 01, 2012 at 19:48 UTC ( #996725=note: print w/ replies, xml ) | Need Help?? |
|
Like with unpacking from numbers it seems Perl first converts the raw binary data into a string representation of a gigantic decimal number, then it tries to unpack from that, giving bizarre results that do not correspond to the original byte order. Also, it seems the "b" and "B" flags to unpack expect the value to be a string of 1's and 0's, not a number. Please help me answer my original question. How do I convert a value which perl thinks is the scalar "\xd\xe\xa\xd\xb\xe\xe\xf" into a scalar with the numeric value 0xDEADBEEF ?
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||