Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Text::CSV uses Text::CSV_XS if it is available for the platform. It seems to me that using CSV_XS directly means the code won't work on a platform without XS capabilities whereas it would have worked if Text::CSV had been used. From reading the pod I don't see any advantage to using Text::CSV_XS directly. Have I missed something?

Probably not. I think it's just a problem of the timeline, or an old habit.

According to CPAN, Text::CSV 0.01 was released on 1997-Jul-31, followed by 1.00 on 2007-Nov-27, more than 10 years later. Text::CSV_XS 0.16 was released 1999-Feb-11, followed by several releases up to 0.23 released 2001-Oct-09. During that time, Text::CSV did not change at all. In 2007, both Text::CSV and Text::CSV_XS saw a maintainer change and have been updated since then. During that maintainer change, Text::CSV was "rewritten to make a wrapper to Text::CSV_XS and Text::CSV_PP".

I learned about Text::CSV_XS between 2001 and 2007. During that time, Text::CSV seemed to be an unmaintained and incompatible "first shot" version, and most other modules of that time, including DBD::CSV, used Text::CSV_XS. DBD::CSV still depends on Text::CSV_XS.

Installing Text::CSV should be sufficient, and works without requiring a compiler, but it is slower than the XS version. The Makefile.PL from Text::CSV hints that installing a sufficiently recent XS version makes Text::CSV faster, but it does not attempt to install the XS version, even if a C compiler is available.

Text::CSV_XS, on the other hand, does not depend on Text::CSV, and does not require it to be installed. It requires a working C compiler, but then, it is faster than Text::CSV.

It would be nice if Text::CSV would attempt to install the XS module if that is possible. This way, there would be no need to install Text::CSV_XS manually.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^3: Split function by afoken
in thread Split function by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (3)
    As of 2014-10-22 04:12 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      For retirement, I am banking on:










      Results (112 votes), past polls