Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Announce > ANNOUNCE: Text-...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 1061 of 1084
Post > Topic >>

ANNOUNCE: Text-CSV_XS 0.43

by "H.Merijn Brand" <h.m.brand@[EMAIL PROTECTED] > Apr 22, 2008 at 04:01 PM

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@[EMAIL PROTECTED]
>

        * 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@[EMAIL PROTECTED]
>

        * 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$,1rp(Bis. 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$,1x2(B>error_diag ();
        $csv$,1x2(B>error_diag ();
        $error_code   = 0  + $csv$,1x2(B>error_diag ();
        $error_str    = "" . $csv$,1x2(B>error_diag ();
        ($cde, $str, $pos) = $csv$,1x2(B>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$,1ry(Bs value is 1$,1x2(Bbased.

       If called in scalar context, it will return the diagnostics in a 
single
       scalar, a$,1x2(Bla $!. 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$,1x2(B>SetDiag (0);

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




 1 Posts in Topic:
ANNOUNCE: Text-CSV_XS 0.43
"H.Merijn Brand"  2008-04-22 16:01:57 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 1:17:43 CDT 2008.