Well, I am sorry, I understand your point, but I have to disagree somewhat with that. Yes, in the general case of CSV files with complicated rules on separating, escaping and quoting characters (and so on), by all means use the Text::CSV or some other CSV specialized module.

But you don't need a 30-ton truck to deliver one TV set to a residential home. (It might even be counterproductive.)

To me, using a CSV module for such an extremely simple CSV file is just plain over-engineering or technical overkill. For that, the split is just the right tool, efficient, simple, very well integrated into the language, easy to use. I do not see any reason to make things more complicated than they should be when they can be very simple. This is really not my view of the Perl philosophy: make simple things simple...

Update: Hehe, 3 negative XP points for stating something that should be obvious, i.e. that there is not just one single solution for absolutely everuthing, I thought the monks here had more freedom to think independently. ;-)


In reply to Re^2: Extracting data from CSV file by Laurent_R
in thread Extracting data from CSV file + Extracting selected few lines through perl by NicholasNVS

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.