in reply to Re^9: Out of memory problems
in thread Out of memory problems

Sorry for being a headache here but doing binary with perl is new to me. What if the file isn't byte aligned, meaning I need to work at a bit level?

Replies are listed 'Best First'.
Re^11: Out of memory problems
by BrowserUk (Patriarch) on Oct 26, 2004 at 12:45 UTC

    Then you're back to using unpack 'B*', ....

    However, there is still no need to read the whole file into memory. The same techniques used for the byte aligned would work just the same for bit aligned once you convert the stream to asci-ized binary. I would probably chain two processes together.

    1. Convert to ascii-ized binary, locate the offset and discard the junk using the same process as above.

      Having aligned the datastream, it would then convert back to properly byte aligned binary and write 384 bytes binary packets to STDOUT.

    2. The second process would just be the working byte aligned version above.

    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
      You help has been greatly appreciated. Thanks again.