in reply to Re: accessing bits in a file
in thread accessing bits in a file

Hi, I have tried to use vec, and it doesn't seem to solve my problem, since it doesn't return arbitrary number of bits at arbitrary offset. I can use any offset, but then I will get a single bit. Am I correct? I also tried to use:
new Parse::Binary::FixedFormat [ qw(sync:b8 tei:b1 pusi:b1 tp:b1 PID:b +13) ];
This gives me 0000000001000 in PID instead of expected 0100100000001. I wonder why? Thanks, Andrey.

Replies are listed 'Best First'.
Re^3: accessing bits in a file
by moritz (Cardinal) on Apr 21, 2010 at 13:22 UTC
    Hi, I have tried to use vec, and it doesn't seem to solve my problem, since it doesn't return arbitrary number of bits at arbitrary offset
    You can call it multiple times in a loop.
    Perl 6 - links to (nearly) everything that is Perl 6.