in reply to Selective Check of Multiple Arrays With Single Construct

Instead of doing doubly-nested loops where you check everything in A against everything in B, you can use the %all hash to do it all in one pass:
use Data::Dumper; my @arA = qw( lion tiger dog cat snake); my @arB = qw( tiger dragon lion); my @arC = qw(dog phoenix); my %all; @all{@arA} = (); for (@arB) { next unless exists $all{$_}; push @{$all{$_}}, "$_ - from array B"; } for (@arC) { next unless exists $all{$_}; push @{$all{$_}}, "$_ - from array C"; } print Dumper \%all;
If something from array A was not found in the other arrays, it will exist in %all with an undefined value. You can grep these out at the end if you prefer.

It would be easy to make this extensible (for arrays D, E, F, etc) if @arB, @arC were named like @{$arrays{B}} and @{$arrays{C}}. I'll leave that to you.

blokhead