Without changing your basic approach, I'd note that
index($string, 'literal') is a good option for finding literal strings without having to break out the full power of regexes (although probably the compiler already does essentially this for you); and that also there's the old favourite
$count = $string =~ tr/c/, which puts in
$count the number of occurrences of the character
c in
$string.
UPDATE: Whoops, RMGir already gave the index-based solution.