in reply to Counting matches.
$_ = 'baa baa black sheep'; my $length = 3; print tr/a// >= $length ? 'OK' : 'NOK'; [download]