note
ariels
Here's [TMTOWTDI|another way to do it], if I correctly understand what you want to do. You want to find an index <tt>$i</tt> for which <tt>$a[$i] eq $a and $b[$i] ne $b</tt> (that is, your condition holds at the same index). So why are you searching the array elements? It's better to search for an appropriate <em>index</em>!
<code>
@indices = grep
{ $a[$_] eq $a and $b[$_] ne $b }
(0..$#a);
</code>
39880
39880