Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: The future of Text::CSV_XS - TODO

by markjugg (Curate)
on Jun 24, 2008 at 12:43 UTC ( #693726=note: print w/replies, xml ) Need Help??


in reply to The future of Text::CSV_XS - TODO

Hello H.Merijn. Is it possible to make this a recoverable error? "HR - bind_columns () did not pass enough refs for parsed fields"

I know some rows will be too short. I just want to skip them or log them and move on. Or maybe there's a a way I can "pre-test" them before calling getline()?

Replies are listed 'Best First'.
Re^2: The future of Text::CSV_XS - TODO
by Tux (Abbot) on Jun 25, 2008 at 07:15 UTC

    Text::CSV_XS comes with examples. There is csv-check and parser-xs.pl. Both show ways to parse (broken) CSV files reliably. Take the latter as an example.

    Making fatal errors recoverable is very hard, as the module does not buffer. Once the stream has been read, it is hard to backup in it. You can still probably use $csv->error_input () after a caught eval'ed failure.


    Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://693726]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2016-12-03 22:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (60 votes). Check out past polls.