in reply to Match a comma between two words
my @headings = split /(?<=")\s*,\s*(?=")/, $line;
But that makes no attempt at tokenizing and parsing the line for balanced quotes, escaped quotes in a field, or quoted commas. If you need to deal with those issues, you've got more work ahead of you, the complexity of which is why people tend to recommend and use Text::CSV.
Dave
|
|---|