Text::CSV::Easy - Easy CSV parsing and building
Version 0.54
use Text::CSV::Easy qw( csv_build csv_parse ); $csv = csv_build(@fields); @fields = csv_parse($csv);
Text::CSV::Easy is a simple module for parsing and building CSV strings. This module itself is a lightweight wrapper around Text::CSV::Easy_XS or Text::CSV::Easy_PP.
This module conforms to RFC 4180 (http://tools.ietf.org/html/rfc4180) for both parsing and building of CSV lines.
abc,def, ghi => ( 'abc', 'def', ' ghi' )
"abc","def" => ( 'abc', 'def' )
"a,b","a\nb","a""b" => ( 'a,b', "a\nb", 'a"b' )
abc,def\n => ( 'abc', 'def' ) abc,def\r\n => ( 'abc', 'def' )
When building a string using csv_build, all non-numeric strings will always be enclosed in quotes.
Takes a list of fields and will generate a csv string. This subroutine will raise an exception if any errors occur.
Parses a CSV string. Returns a list of fields it found. This subroutine will raise an exception if a string could not be properly parsed.
Returns the underlying module used for CSV processing.
Version 2
The TCE_VERSION ensures that the XS and PP versions of Text::CSV::Easy are consistent.
Thomas Peters, <weters@me.com>
Copyright (C) 2013 by Thomas Peters
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.4 or, at your option, any later version of Perl 5 you may have available.
To install Text::CSV::Easy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::CSV::Easy
CPAN shell
perl -MCPAN -e shell install Text::CSV::Easy
For more information on module installation, please visit the detailed CPAN module installation guide.