Like I suggested in reply to this question, Text::Parsewords might do the trick. I've never used the CSV module mentioned in another reply, so I wouldn't know how to go about using it to solve this problem, but it should be possible with ParseWords.
Comment on Re: Counting number of double quotes in a string