andreyb051 has asked for the wisdom of the Perl Monks concerning the following question:
gives "0000000100011" binarymy @z = unpack ("B11 B13", $buf);
I performed this operation by binary mathematics, but I can't use this as a solution because it is not flexible. I need a general solution, that will allow flexibility of choosing different offsets and field width easily. (In general I am parsing a bit aligned structure...) Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: accessing bits in a file
by BrowserUk (Patriarch) on Apr 21, 2010 at 12:18 UTC | |
|
Re: accessing bits in a file
by almut (Canon) on Apr 21, 2010 at 15:05 UTC | |
|
Re: accessing bits in a file
by jwkrahn (Abbot) on Apr 21, 2010 at 14:53 UTC | |
|
Re: accessing bits in a file
by moritz (Cardinal) on Apr 21, 2010 at 12:03 UTC | |
by andreyb051 (Initiate) on Apr 21, 2010 at 13:08 UTC | |
by moritz (Cardinal) on Apr 21, 2010 at 13:22 UTC |