http://www.perlmonks.org?node_id=1028


in reply to Counting Substrings in Strings

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