in reply to Counting Substrings in Strings

$count = $string =~ tr/x/x/; Will make $count = num of x's in $string.