Have a look tr "Transliterates all occurrences of the characters found in the search list with the corresponding character in the replacement list." (from perlop). For example:
$string="abc%def%.%";
$count = ($string =~ tr/%//);
print "There are $count %s in the string";