Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Getting columns from cvs file in perl

by thezip (Vicar)
on Apr 24, 2007 at 13:45 UTC ( #611737=note: print w/replies, xml ) Need Help??


in reply to Re: Getting columns from cvs file in perl
in thread Getting columns from csv file in perl

You should also check the returned status when you parse a line:

my $csv = Text::CSV_XS->new( { binary => 1 } ); my $status = $csv->parse($line); # parse a CSV string into fie +lds

Occasionally, you'll encounter an invalid CSV line and you'll definitely want to handle it. If there are any embedded binary chars, you'll want to set the binary flag when you create the $csv object as I did above.


Where do you want *them* to go today?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://611737]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2017-01-23 00:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (190 votes). Check out past polls.