Perl: the Markov chain saw | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Assuming your bitfields are all multiples of 8, then using unpack's length/type nomenclature will work. You'll need to use the correct variations of 'c' or 'C' (probably the latter) and b/B (which will depend upon the endianess of the originating hardware. I've used a mixture here to demonstrate the affect of some of the combinations. Note also that the output is ascii-ised binary. That is, each bit of the input is translated to a byte containing ascii '0' or ascii '1'. Other variations are possible. For example, you might want to retain the bits as binary encoded fields and then manipulate them with vec. But you'd need to explain more about what they are. With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In reply to Re: Unpacking variable length bit fields
by BrowserUk
|
|