fork(3) download
  1. my @data = <main::DATA>;
  2.  
  3. foreach (@data)
  4. {
  5. my @columns = (/(?:(?<=^")|(?<=",")).*?(?:(?="\s*$)|(?=","))/g);
  6. foreach (@columns)
  7. {
  8. print "'$_'\n";
  9. }
  10. print "\n";
  11. }
  12.  
  13. __DATA__
  14. "ID-1","A "B"", C, D, E","Today"
  15. "ID-2","A, B, C, D, E,F","Yesterday"
  16. "ID-3","A and nothing else","Today"
  17.  
Success #stdin #stdout 0s 4552KB
stdin
Standard input is empty
stdout
'ID-1'
'A "B"", C, D, E'
'Today'

'ID-2'
'A, B, C, D, E,F'
'Yesterday'

'ID-3'
'A and nothing else'
'Today'