puterboy has asked for the wisdom of the Perl Monks concerning the following question:
I have a bitstream containging 3 length fields and the corresponding 3 fields
The bitstream is layed out as follows:
<length field 1 in bits (1 byte)> <field 1> <length field 2 in bits (1 byte)> <field 2> <length field 3 in bits (1 byte)> <field 3>
I am hoping that there is some clever way to do this with unpack but I don't know how to get the field length while also unpacking without iteratively calling pack.
The bitstream is layed out as follows:
<length field 1 in bits (1 byte)> <field 1> <length field 2 in bits (1 byte)> <field 2> <length field 3 in bits (1 byte)> <field 3>
I am hoping that there is some clever way to do this with unpack but I don't know how to get the field length while also unpacking without iteratively calling pack.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Unpacking variable length bit fields
by BrowserUk (Patriarch) on Jun 18, 2012 at 20:58 UTC | |
by puterboy (Scribe) on Jun 19, 2012 at 04:15 UTC | |
by BrowserUk (Patriarch) on Jun 19, 2012 at 05:30 UTC | |
by puterboy (Scribe) on Jun 18, 2012 at 22:58 UTC | |
Re: Unpacking variable length bit fields
by ikegami (Patriarch) on Jun 18, 2012 at 21:27 UTC | |
Re: Unpacking variable length bit fields
by Limbic~Region (Chancellor) on Jun 18, 2012 at 20:36 UTC |
Back to
Seekers of Perl Wisdom