in reply to Counting number of double quotes in a string

You will probably want to check out the Text::CSV_XS module, which can do parsing of CSV files for you and will make your life a lot easier.

But to answer your question directly, to count the number of double-quote characters in a line, do this:

$count = ($line =~ y/"//);