in reply to Parsing a string

Text::CSV, don't even think of anything else.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: Parsing a string
by ikegami (Patriarch) on Feb 22, 2011 at 16:47 UTC

    I'd think of Text::CSV_XS :) At best, Text::CSV is a needless intermediary.

    (Upd: To clarify, using Text::CSV might be wiser if you're distributing a non-XS module or application, but for your own code, it can only introduce problems. )

Re^2: Parsing a string
by tilly (Archbishop) on Feb 22, 2011 at 17:42 UTC
      One reason could be no support for blank_is_undef/ empty_is_undef :)
        The default behavior matches blank_is_undef, but you can easily put a compute on any field that munges undef/blank/whatever values in any way you want.

        Incidentally this is the first time that anyone has asked me for anything like that feature.

      My bad tilly, I have never used your Text::xSV before, but if the opportunity presents itself, I will give it a spin.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James