Won't pack convert each column into bytes?
No. When pack is used with the 'b' template it converts (packs!) each 0 or 1 in the input string to a single bit.
So for your 880 field CSV, the output is a 110 byte string.
Once you've converted both files to binary format, you can compare two records (count the number of bits set in both strings) using:
my $bitsInCommon = unpack '%32b*', ( $record1 & $record2 );
In reply to Re^3: Bit handling in Perl
by BrowserUk
in thread Bit handling in Perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |