if( 2 == ( ()= $outs =~ m|A|gs ) ){ print "exactly 2 matches\n" }