http://www.perlmonks.org?node_id=1071987


in reply to Low-threshold function in Text::CSV_XS

Tie::CSV_File seems like a nice abstraction on CSV. The only thing lacking is it would be nice to be able to tell it that the top CSV row specifies column names, or to be able to supply a list of column names, and then get an AoH instead of the default AoA.


Dave

  • Comment on Re: Low-threshold function in Text::CSV_XS

Replies are listed 'Best First'.
Re^2: Low-threshold function in Text::CSV_XS
by Tux (Canon) on Jan 25, 2014 at 12:45 UTC

    Tie::CSV_File fills a niche, but does not lower the threshold for beginners. I even think that using tie is way outside of the problem I am trying to understand: to lower the barrier to use CSV *safely* and reliable without people complaining the API is too difficult.

    Using tie, I personally prefer to use Tie::Hash::DBD in combination with DBD::CSV, as I can then transparently switch to DBD::SQLite, DBD::Pg or any other relational database when CSV turns out to be too slow.


    Enjoy, Have FUN! H.Merijn