in reply to confusing array comparison

I had to read your description a few times to see that your question wasn't what BrowserUK answered. Given the arrays you list above, try something like this:
my %A; for (0..$#A_v_B1) { $A{$A_v_B1[$_]}{B} = $A_v_B2[$_]; } for (0..$#A_v_C1) { $A{$A_v_C1[$_]}{C} = $A_v_C2[$_]; }
That will give you a hash A that looks like this:
A101 => { B => B302, C => C302 }, A103 => { B => B405 }, A104 => { B => B406 }, A106 => { C => C305 }, A109 => { C => C306 },
From there, you can see what elements of A have matches in which other sets, and what those matches are. You can build up hashes for B, C, and D similarly, if needed.

Caution: Contents may have been coded under pressure.