in reply to Re: Text::CSV_XS - proposed new interface
in thread Text::CSV_XS - proposed new interface

Yes, thanks, I probably will support filehandles as well as filenames. As for embedded newlines, the module already does (and always has) supported them. Just set binary=>1 in the call to new().
  • Comment on Re^2: Text::CSV_XS - proposed new interface

Replies are listed 'Best First'.
Re^3: Text::CSV_XS - proposed new interface
by freddo411 (Chaplain) on Dec 16, 2004 at 18:41 UTC
    As for embedded newlines, the module already does (and always has) supported them. Just set binary=>1 in the call to new().
    Yes that's true, but my script is grabing and reading line by line, so that when I grab line one, I get data from the begining of the line up until the first EOL, which might be in a quoted field, not the true EOL.

    My kludge is to catch this error, append the next line to the first, and try again. Do this until the line parses correctly.

    That algorythm works out OK until there is a malformed data file. Now my program doesn't die until the whole file is thru an attempted read.

    I think the new interface will let me catch the error on a specific line read, which is a net win for me.

    Cheers

    -------------------------------------
    Nothing is too wonderful to be true
    -- Michael Faraday

      You should be using the getline() method - it gets one line of data, ignoring embedded newlines. But the new interface will do that automatically.