if ( $outs =~ tr/D// == 2) { print "exactly 2 matches for D\n" }