|
|
| Perl: the Markov chain saw | |
| PerlMonks |
Re: converting artibrary binary data to numeric valuesby Corion (Pope) |
| on Sep 30, 2012 at 18:08 UTC ( #996522=note: print w/ replies, xml ) | Need Help?? |
|
That's exactly what unpack (and pack for the documentation) are for. Depending on whether your sending device sends in big-endian or little-endian order, the N or V template elements look like you want them. Also, if you have the C++ source code of the remote end, consider Struct::Binary::C, which was written for importing C structs sensibly into Perl.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||