in reply to accessing bits in a file
sub nBitsAt{ my( $n, $offset, $bits ) = @_; return unpack "x[A$offset] A$n", unpack "B*", $bits; } print nBitsAt( 13, 11, "\x47\x69\x01" );; 0100100000001 [download]