Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

sqldatasource dal, wwwxxxenden, convert raid5 to raid 10 mdadm, apache force chunked, nrao wwwxxx, xxxxxdup, procmail change subject header, wwwXxx not20, Wwwxxx.doks sas, linux raid resync after reboot

Links

XODOX
Impressum

#1: ANNOUNCE: Text-CSV_XS 0.43

Posted on 2008-04-22 18:02:20 by h.m.brand

On popular demand ...

file: $CPAN/authors/id/H/HM/HMBRAND/Text-CSV_XS-0.43.tgz
size: 87473 bytes
md5: 47f9a2011dd0afba7cb0ee967a592aa3

2008-04-21 0.43 - H.Merijn Brand <h.m.brand@xs4all.nl>

* parse errors try to remember failing position
* used valgrind to test for leaks (devel-only)
* used Test::Valgrind as alternative leak check (devel-only)
* improve documentation for error 2023
* nailed the loose quotes in quoted fields

2008-04-16 0.42 - H.Merijn Brand <h.m.brand@xs4all.nl>

* Generate META.yml myself. I won't use Build.PL
* Array-refs now accept scalars with magic:
$csv->print (*STDOUT, $sth->{NAME_lc});
* More/better examples
* Added t/76_magic.t

Some highlights ...

allow_loose_quotes
By default, parsing fields that have "quote_char" characters
inside
an unquoted field, like

1,foo "bar" baz,42

would result in a parse error. Though it is still bad practice
to
allow this format, we cannot help there are some vendors that
make
their applications spit out lines styled like this.

In case there is really bad CSV data, like

1,"foo "bar" baz",42

or

1,""foo bar baz"",42

there is a way to get that parsed, and leave the quotes inside
the
quoted field as‐is. This can be achieved by setting
"allow_loose_quotes" AND making sure that the "escape_char" is
not
equal to "quote_char".

error_diag

Text::CSV_XS−>error_diag ();
$csv−>error_diag ();
$error_code = 0 + $csv−>error_diag ();
$error_str = "" . $csv−>error_diag ();
($cde, $str, $pos) = $csv−>error_diag ();

If (and only if) an error occured, this function returns the
diagnostics of that error.

If called in void context, it will print the internal error code and
the associated error message to STDERR.

If called in list context, it will return the error code and the
error
message in that order. If the last error was from parsing, the third
value returned is the best guess at the location within the line
that
was being parsed. It’s value is 1−based.

If called in scalar context, it will return the diagnostics in a
single
scalar, a−la $!. It will contain the error code in numeric context,
and
the diagnostics message in string context.

When called as a class method or a direct function call, the error
diag
is that of the last "new ()" call.

SetDiag

$csv−>SetDiag (0);

Use to reset the diagnosticts if you are dealing with errors.

Report this message