Another option is to look at vec which is a little more general and may give you access to a column represented in the binary file without unpacking. I have no deep knowledge of which is the better approach and using pack as above is certainly a good option.
Sometimes I can think of 6 impossible LDAP attributes before breakfast.
If I understand the OP correctly; He seems to want to compare all of the bits in each record in file one, with the corresponding bits in every (50M) record of file two.
Whilst iterating over the 880 bits in each vector using a loop and vec is certainly possible; it is really quite slow.
Indeed, it is much, much slower than performing such comparisons en-masse using perl's bit-wise boolean string operations.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
Note that the "b" template for pack packs in ascending bit order within each byte which is like vec so it probably makes sense to create each record using pack and access bits (columns) within a record using vec.