in reply to Counting how many times a character is in a string.
my $pcount = $str =~ tr/%//; [download]
See tr.
Makeshifts last the longest.