foreach my $x (@$arr1) { if ($x eq $1) {$found++} }