file: $CPAN/authors/id/H/HM/HMBRAND/Text-CSV_XS-0.40.tgz size: 85057 bytes md5: cb8b2af20925b832159f34eed9793666 2008-04-07 0.40 - H.Merijn Brand * Implemented getline_hr () and column_names () RT 34474 (suggestions accepted from Mark Stosberg) * Corrected misspelled variable names in XS * Functions are now =head2 type doc entries (Mark Stosberg) * Make SetDiag() available to the perl level, so errors can be centralized and consistent * Integrate the non-XS errors into XS * Add t/75_hashref.t * Testcase for error 2023 (Michael P Randall) * Completely refactored the XS part of parse/getline, which is now up to 6% faster. YMMV * Completed bind_columns. On straight fetches now up to three times as fast as normal fetches (both using getline ()) getline_hr The "getline_hr ()" and "column_names ()" methods work together + to allow you to have rows returned as hashrefs. You must call "column_names ()" first to declare your column names. $csv->column_names (qw( code name price description )); $hr = $csv->getline_hr ($io); print "Price for $hr->{name} is $hr->{price} EUR\n"; "getline_hr ()" will croak if called before "column_names ()". column_names Set the keys that will be used in the "getline_hr ()" calls. If + no keys (column names) are passed, it'll return the current setting. "column_names ()" accepts a list of scalars (the column names) +or a single array_ref, so you can pass "getline ()" $csv->column_names ($csv->getline ($io)); "column_names ()" croaks on invalid arguments. bind_columns Takes a list of references to scalars (max 255) to store the fi +elds fetched "by getline_hr ()" in. When you don't pass enough refer +ences to store the fetched fields in, "getline ()" will fail. If you pas +s more than there are fields to return, the remaining references are l +eft untouched. $csv->bind_columns (\$code, \$name, \$price, \$description); while ($csv->getline ()) { print "The price of a $name is \x{20ac} $price\n"; }

Enjoy, Have FUN! H.Merijn

In reply to Re: The future of Text::CSV_XS - TODO by Tux
in thread The future of Text::CSV_XS - TODO by Tux

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, 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
  • 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.