Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re (tilly) 1: Text::xSV

by graff (Chancellor)
on Apr 12, 2002 at 18:12 UTC ( #158640=note: print w/replies, xml ) Need Help??


in reply to Re (tilly) 1: Text::xSV
in thread Text::xSV

Tilly, I'd like to suggest an addition to Text::xSV. It would be useful for the calling program to access the list of field header strings that are found in / bound from the first row of a CSV file; i.e. add a method like "get_header" as follows:
sub bind_header { my $self = shift; $self->bind_fields($self->get_row()); $self->{field_name} = [ @{$self->{row}} ]; # this is new delete $self->{row}; } # the following method is new: sub get_header { my $self = shift; if ( exists( $self->{field_name} )) { return wantarray ? @{$self->{field_name}} : $self->{field_name +}; } }

That works for me, but maybe you would want to do it a little differently. Thanks very much for this module, and for your discussions in various threads about CSV data -- you got my vote.

Replies are listed 'Best First'.
Re: Re (tilly) 1: Text::xSV
by tilly (Archbishop) on May 01, 2003 at 15:50 UTC
    I intend to retake maintainance of Text::xSV again. I had hoped to have time to make various improvements today, but that doesn't look viable at this point. :-(

    However within a month it should sprout some hopefully nice goodies. :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://158640]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2019-11-19 07:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (94 votes). Check out past polls.

    Notices?