in reply to accessing bits in a file

Maybe vec is helpful for you?

Replies are listed 'Best First'.
Re^2: accessing bits in a file
by andreyb051 (Initiate) on Apr 21, 2010 at 13:08 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. 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.
      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.