in reply to count special character
perldoc -q count [download]
And amazingly, it will answer your question. See also: perlfaq4.
$count = ($string =~ tr/\"//); print "There are $count [\" ] characters in the string"; [download]