The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Text::CSV::Easy - easy csv parsing and building

VERSION

Version 0.01

SYNOPSIS

use Text::CSV::Easy qw( csv_build csv_parse );
$csv = csv_build(@fields);
@fields = csv_parse($csv);

DESCRIPTION

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.

Integers do not need to be quoted, but strings must be quoted:

1,"two","three"     OK
"1","two","three"   OK
1,two,three         NOT OK

If you need to use a literal quote ("), escape it with another quote:

"one","some ""quoted"" string"

SUBROUTINES

csv_build( List @fields ) : Str

Takes a list of fields and will generate a csv string. This subroutine will raise an exception if any errors occur.

csv_parse( Str $string ) : List[Str]

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.

module( ) : Str

Returns the underlying module used for CSV processing.

SEE ALSO

Text::CSV
Text::CSV::Easy_PP
Text::CSV::Easy_XS

AUTHOR

Thomas Peters, <weters@me.com>

COPYRIGHT AND LICENSE

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.