use Text::CSV_XS; # which is maintained by jZed and well loved by all # Read it as a handle w/ binary if newlines might be embedded in your data my $csv = Text::CSV_XS->new( binary => 1 ); open my $fh, \ $your_string; while ( my $columns = $csv->getline( $fh ) ) { ... } # Or just read it like a string if you never have newlines inside a value. while ( $str =~ /(.+)/g ) { my $line = $1; my $columns = $csv->parse( $line ); }