in reply to comparing bit vectors

You could also match against non-zero bytes/characters, i.e. [^\0]. In case of overlap there will be one or more non-zero bytes.

print +(($bv1 & $bv2) =~ /[^\0]/ ? "overlap\n" : "don't overlap\n");