All the Perl that's Practical to Extract and Report

Navigation

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Without JavaScript enabled, you might want to
use the classic discussion system instead. If you login, you can remember this preference.

* 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.

Set the keys that will be used in the "getline_hr ()" calls. If no keys (column names) are passed, it&#8217;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&#8722;>column_names ($csv&#8722;>getline ($io));

"column_names ()" croaks on invalid arguments.

bind_columns

Takes a list of references to scalars (max 255) to store the fields fetched "by getline_hr ()" in. When you don&#8217;t pass enough references to store the fetched fields in, "getline ()" will fail. If you pass more than there are fields to return, the remaining references are left untouched.