$count[$i]++ and last if $_ ~~ $patterns[$i];