This is generally more complex than it looks because of escaped quotation marks and that sort of thing. Indeed, there are many cases that you have to deal with in such situations. You might want to check out Text::Balanced, which could help.
Who is Kayser Söze?
Comment on Re: need to recognize string literals and ignore then during parsing.