sub aeq { my ($first, $second, @comp) = @_; return 0 if @{$first} != @{$second}; @comp = grep {$first->[$_] eq $second->[$_]} 0..$#$first; wantarray ? @comp : @comp == @$first; }