in reply to Comparison effeciency

If I were you, I'd split $current_case once, and put the values in a hash. Then, I'd loop through your $j loop, checking for the existence of keys in the hash.

That way, you don't repeat the split and comparison for each case for each bit.

I can do demo code if you need it, drop me a message.

Very Fast Update: My example could would strongly resemble that of Masem. So don't message me, use his instead.