in reply to Reading individual bits

Have a look at Bit::Vector. It's main routines are written in C and execute about 5 times faster than native perl for me. And it contains quite high-level subroutines, which makes programming more fun.