Text::CSV::LibCSV - comma-separated values manipulation routines (using libcsv)
use Text::CSV::LibCSV; my $callback = sub { my @fields = @_; print(join(',', @fields), "\n"); }; csv_parse($data, $callback) or die; # or using OO interface my $parser = Text::CSV::LibCSV->new; $parser->parse($data, $callback) or die $parser->strerror;
This module is an interface for libcsv. It is available at: http://sourceforge.net/projects/libcsv/
WARNING: Please note that this module is primarily targetted for libcsv >= 1.0.0, so if things seem to be broken and your libcsv version is below 1.0.0, then you might want to consider upgrading libcsv first.
Initialize parser object.
Option can be set CSV_STRICT or CSV_REPALL_NL. Read libcsv's documentation for details.
Returns an instance of this module.
Set options.
Parse a CSV string.
Callback function is called at the end of every row.
Returns true on success or undef on failure.
You can get error message by strerror.
Parse a CSV string from file.
Parse a CSV string from file handle.
You can use parse() in the same way.
parse()
NOTE: parse_file() and parse_fh() read all data to memory once. It is not necessarily the case that they work faster than parse.
parse_file()
parse_fh()
Returns error message.
csv_parse, CSV_STRICT, CSV_REPALL_NL
Jiro Nishiguchi <jiro@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
http://sourceforge.net/projects/libcsv/
To install Text::CSV::LibCSV, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::CSV::LibCSV
CPAN shell
perl -MCPAN -e shell install Text::CSV::LibCSV
For more information on module installation, please visit the detailed CPAN module installation guide.