Help for this page
# You need to match a double quoted string with the following regex # [^"\\]*(\\.[^"\\]*)*",? ... # , # # this must be repeated with m/.../g
@fields = (); while ($text =~ m/"([^"\\]*(\\.[^"\\]*)*)",?|([^,]+),?|,/g { ... push (@fields, undef) if $text =~ m/,$/; # Account for the special cas +e of an empty last field. # all data is now in @fields