Hello community,
here is the log from the commit of package perl-Text-CSV_XS for
openSUSE:Factory checked in at 2020-06-03 20:30:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Text-CSV_XS (Old)
and /work/SRC/openSUSE:Factory/.perl-Text-CSV_XS.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Text-CSV_XS"
Wed Jun 3 20:30:33 2020 rev:42 rq:809880 version:1.43
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Text-CSV_XS/perl-Text-CSV_XS.changes
2020-02-22 18:59:24.541519673 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Text-CSV_XS.new.3606/perl-Text-CSV_XS.changes
2020-06-03 20:30:47.692858491 +0200
@@ -1,0 +2,31 @@
+Thu May 28 03:14:24 UTC 2020 - Tina Müller <[email protected]>
+
+updated to 1.43
+ see /usr/share/doc/packages/perl-Text-CSV_XS/ChangeLog
+
+ 1.43 - 2020-05-27, H.Merijn Brand
+ * Add --parser-opt[=value] to csv-check
+ * Add -L & -X to csv-check
+ * Fix undef value in attribute setters for strings (issue 24)
+ * Document quote (undef) is not supported
+
+
+-------------------------------------------------------------------
+Wed May 20 03:14:18 UTC 2020 - Tina Müller <[email protected]>
+
+updated to 1.42
+ see /usr/share/doc/packages/perl-Text-CSV_XS/ChangeLog
+
+ 1.42 - 2020-05-19, H.Merijn Brand
+ * Update to Devel::PPPort-3.58
+ * Unicode fixes for csv2xls and csv2xlsx
+ * Add internal buffers to cache diagnostics
+ * Fix positional reporting in examples/csv-check
+ * Allow passing CSV parsing attributes to csv-check
+ * Proof reading - doc fixes by Klaus Baldermann <soonix> (PR#21)
+ * Fix type caching (RT#132344)
+ * Small doc fix by Nick Tonkin <1nickt> (PR#22)
+ * Fix sep=; being ignored in ->header (issue 23)
+
+
+-------------------------------------------------------------------
Old:
----
Text-CSV_XS-1.41.tgz
New:
----
Text-CSV_XS-1.43.tgz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Text-CSV_XS.spec ++++++
--- /var/tmp/diff_new_pack.UoTmlF/_old 2020-06-03 20:30:48.448860789 +0200
+++ /var/tmp/diff_new_pack.UoTmlF/_new 2020-06-03 20:30:48.452860802 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-Text-CSV_XS
#
-# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,19 +17,19 @@
Name: perl-Text-CSV_XS
-Version: 1.41
+Version: 1.43
Release: 0
%define cpan_name Text-CSV_XS
Summary: Comma-separated values manipulation routines
License: Artistic-1.0 OR GPL-1.0-or-later
Group: Development/Libraries/Perl
-Url: https://metacpan.org/release/%{cpan_name}
+URL: https://metacpan.org/release/%{cpan_name}
Source0:
https://cpan.metacpan.org/authors/id/H/HM/HMBRAND/%{cpan_name}-%{version}.tgz
Source1: cpanspec.yml
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
-Recommends: perl(Encode) >= 3.02
+Recommends: perl(Encode) >= 3.06
%{perl_requires}
%description
++++++ Text-CSV_XS-1.41.tgz -> Text-CSV_XS-1.43.tgz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Text-CSV_XS-1.41/CSV_XS.pm
new/Text-CSV_XS-1.43/CSV_XS.pm
--- old/Text-CSV_XS-1.41/CSV_XS.pm 2020-01-31 07:59:54.000000000 +0100
+++ new/Text-CSV_XS-1.43/CSV_XS.pm 2020-05-27 08:46:14.000000000 +0200
@@ -26,10 +26,10 @@
use Carp;
use vars qw( $VERSION @ISA @EXPORT_OK );
-$VERSION = "1.41";
+$VERSION = "1.43";
@ISA = qw( Exporter );
@EXPORT_OK = qw( csv );
-XSLoader::load "Text::CSV_XS", $VERSION;
+XSLoader::load ("Text::CSV_XS", $VERSION);
sub PV { 0 }
sub IV { 1 }
@@ -268,13 +268,13 @@
formula => 38,
strict => 42,
undef_str => 46,
+ types => 50,
);
# A `character'
sub _set_attr_C {
my ($self, $name, $val, $ec) = @_;
- defined $val or $val = 0;
- utf8::decode ($val);
+ defined $val and utf8::decode ($val);
$self->{$name} = $val;
$ec = _check_sanity ($self) and croak ($self->SetDiag ($ec));
$self->_cache_set ($_cache_id{$name}, $val);
@@ -588,10 +588,12 @@
if (my $types = shift) {
$self->{_types} = join "", map { chr } @{$types};
$self->{types} = $types;
+ $self->_cache_set ($_cache_id{types}, $self->{_types});
}
else {
delete $self->{types};
delete $self->{_types};
+ $self->_cache_set ($_cache_id{types}, undef);
undef;
}
}
@@ -911,6 +913,10 @@
}
my ($ahead, $eol);
+ if ($hdr and $hdr =~ s/\Asep=(\S)([\r\n]+)//i) { # Also look in xs:Parse
+ $self->sep ($1);
+ length $hdr or $hdr = <$fh>;
+ }
if ($hdr =~ s/^([^\r\n]+)([\r\n]+)([^\r\n].+)\z/$1/s) {
$eol = $2;
$ahead = $3;
@@ -1800,6 +1806,9 @@
When set, overrules L<C<quote_char>|/quote_char>. If its length is one byte
it acts as an alias to L<C<quote_char>|/quote_char>.
+This method does not support C<undef>. Use L<C<quote_char>|/quote_char> to
+disable quotation.
+
See also L</CAVEATS>
=head3 escape_char
@@ -2022,7 +2031,7 @@
("1", "", undef, " ", "2")
-note that this is specifically important when loading C<CSV> fields into a
+Note that this is specifically important when loading C<CSV> fields into a
database that allows C<NULL> values, as the perl equivalent for C<NULL> is
C<undef> in L<DBI> land.
@@ -2042,7 +2051,7 @@
(1, undef, undef, " ", 2)
-Note that this effects only fields that are originally empty, not fields
+Note that this affects only fields that are originally empty, not fields
that are empty after stripping allowed whitespace. YMMV.
=head3 allow_whitespace
@@ -2231,7 +2240,7 @@
information after parsing with the methods L</meta_info>, L</is_quoted>,
and L</is_binary> described below. Default is false for performance.
-If you set this attribute to a value greater than 9, than you can control
+If you set this attribute to a value greater than 9, then you can control
output quotation style like it was used in the input of the the last parsed
record (unless quotation was added because of other reasons).
@@ -2510,7 +2519,7 @@
Note that L</getline_hr> creates a hashref for every row and will be much
slower than the combined use of L</bind_columns> and L</getline> but still
-offering the same ease of use hashref inside the loop:
+offering the same easy to use hashref inside the loop:
my @cols = @{$csv->getline ($fh)};
$csv->column_names (@cols);
@@ -2528,7 +2537,7 @@
}
Your mileage may vary for the size of the data and the number of rows. With
-perl-5.14.2 the comparison for a 100_000 line file with 14 rows:
+perl-5.14.2 the comparison for a 100_000 line file with 14 columns:
Rate hashrefs getlines
hashrefs 1.00/s -- -76%
@@ -2619,7 +2628,7 @@
cell=3,2-*,* # strip row 1 and 2, and column 1
Cells and cell ranges may be combined with C<;>, possibly resulting in rows
-with different number of columns
+with different numbers of columns
cell=1,1-2,2;3,3-4,4;1,4;4,1
@@ -2671,7 +2680,7 @@
$csv->column_names (undef, "", "name", "name");
$hr = $csv->getline_hr ($fh);
-Will set C<< $hr->{"\cAUNDEF\cA"} >> to the 1st field, C<< $hr->{""} >> to
+will set C<< $hr->{"\cAUNDEF\cA"} >> to the 1st field, C<< $hr->{""} >> to
the 2nd field, and C<< $hr->{name} >> to the 4th field, discarding the 3rd
field.
@@ -2691,7 +2700,7 @@
This method resets some object properties, as it is supposed to be invoked
only once per file or stream. It will leave attributes C<column_names> and
-C<bound_columns> alone of setting column names is disabled. Reading headers
+C<bound_columns> alone if setting column names is disabled. Reading headers
on previously process objects might fail on perl-5.8.0 and older.
Assuming that the file opened for parsing has a header, and the header does
@@ -2761,11 +2770,11 @@
behavior can be disabled by passing a false value to C<detect_bom>.
Supported encodings from BOM are: UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, and
-UTF-32LE. BOM's also support UTF-1, UTF-EBCDIC, SCSU, BOCU-1, and GB-18030
+UTF-32LE. BOM also supports UTF-1, UTF-EBCDIC, SCSU, BOCU-1, and GB-18030
but L<Encode> does not (yet). UTF-7 is not supported.
If a supported BOM was detected as start of the stream, it is stored in the
-abject attribute C<ENCODING>.
+object attribute C<ENCODING>.
my $enc = $csv->{ENCODING};
@@ -2773,7 +2782,7 @@
If the handle was opened in a (correct) encoding, this method will B<not>
alter the encoding, as it checks the leading B<bytes> of the first line. In
-case the stream starts with a decode BOM (C<U+FEFF>), C<{ENCODING}> will be
+case the stream starts with a decoded BOM (C<U+FEFF>), C<{ENCODING}> will be
C<""> (empty) instead of the default C<undef>.
=item munge_column_names
@@ -3035,7 +3044,7 @@
my $quoted = $csv->is_quoted ($column_idx);
-Where C<$column_idx> is the (zero-based) index of the column in the last
+where C<$column_idx> is the (zero-based) index of the column in the last
result of L</parse>.
This returns a true value if the data in the indicated column was enclosed
@@ -3050,7 +3059,7 @@
my $binary = $csv->is_binary ($column_idx);
-Where C<$column_idx> is the (zero-based) index of the column in the last
+where C<$column_idx> is the (zero-based) index of the column in the last
result of L</parse>.
This returns a true value if the data in the indicated column contained any
@@ -3063,7 +3072,7 @@
my $missing = $csv->is_missing ($column_idx);
-Where C<$column_idx> is the (zero-based) index of the column in the last
+where C<$column_idx> is the (zero-based) index of the column in the last
result of L</getline_hr>.
$csv->keep_meta_info (1);
@@ -3162,7 +3171,7 @@
use Text::CSV_XS qw( csv );
-This is an high-level function that aims at simple (user) interfaces. This
+This is a high-level function that aims at simple (user) interfaces. This
can be used to read/parse a C<CSV> file or stream (the default behavior) or
to produce a file or write to a stream (define the C<out> attribute). It
returns an array- or hash-reference on parsing (or C<undef> on fail) or the
@@ -3400,8 +3409,8 @@
=item HASH
X<HASH>
-If C<headers> is an hash reference, this implies C<auto>, but header fields
-for that exist as key in the hashref will be replaced by the value for that
+If C<headers> is a hash reference, this implies C<auto>, but header fields
+that exist as key in the hashref will be replaced by the value for that
key. Given a CSV file like
post-kode,city,name,id number,fubble
@@ -3764,7 +3773,7 @@
} # max_4_fields
csv (in => csv (in => "file.csv"), out => *STDOUT,
- callbacks => { before print => \&max_4_fields });
+ callbacks => { before_print => \&max_4_fields });
This callback is not active for L</combine>.
@@ -4197,14 +4206,14 @@
$csv->print ($fh, [ map { $_ // "\\N" } @$row ]);
}
-note that this will not work as expected when choosing the backslash (C<\>)
+Note that this will not work as expected when choosing the backslash (C<\>)
as C<escape_char>, as that will cause the C<\> to need to be escaped by yet
another C<\>, which will cause the field to need quotation and thus ending
up as C<"\\N"> instead of C<\N>. See also L<C<undef_str>|/undef_str>.
csv (out => "foo.csv", in => sub { $sth->fetch }, undef_str => "\\N");
-these special sequences are not recognized by Text::CSV_XS on parsing the
+These special sequences are not recognized by Text::CSV_XS on parsing the
CSV generated like this, but map and filter are your friends again
while (my $row = $csv->getline ($fh)) {
@@ -4340,7 +4349,7 @@
my @AoH = $csv->parse_file ($filename, { cols => [ 1, 4..8, 12 ]});
-Returning something like
+returning something like
[ { fields => [ 1, 2, "foo", 4.5, undef, "", 8 ],
flags => [ ... ],
@@ -4551,7 +4560,7 @@
1012 "INI - the header contains an empty field"
X<1012>
-The header line parsed in the L</header> is contains an empty field.
+The header line parsed in the L</header> contains an empty field.
=item *
1013 "INI - the header contains nun-unique fields"
@@ -4564,7 +4573,7 @@
1014 "INI - header called on undefined stream"
X<1014>
-The header line cannot be parsed from an undefined sources.
+The header line cannot be parsed from an undefined source.
=item *
1500 "PRM - Invalid/unsupported argument(s)"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Text-CSV_XS-1.41/CSV_XS.xs
new/Text-CSV_XS-1.43/CSV_XS.xs
--- old/Text-CSV_XS-1.41/CSV_XS.xs 2020-01-31 13:12:17.000000000 +0100
+++ new/Text-CSV_XS-1.43/CSV_XS.xs 2020-04-30 15:11:32.000000000 +0200
@@ -116,6 +116,7 @@
#define CACHE_ID_formula 38
#define CACHE_ID_strict 42
#define CACHE_ID_undef_str 46
+#define CACHE_ID_types 50
#define byte unsigned char
#define ulng unsigned long
@@ -473,6 +474,17 @@
}
break;
+ case CACHE_ID_types:
+ if (cp && len) {
+ csv->types = cp;
+ csv->types_len = len;
+ }
+ else {
+ csv->types = NULL;
+ csv->types_len = 0;
+ }
+ break;
+
default:
warn ("Unknown cache index %d ignored\n", idx);
}
@@ -539,13 +551,24 @@
_cache_show_byte ("has_hooks", csv->has_hooks);
_cache_show_byte ("eol_is_cr", csv->eol_is_cr);
_cache_show_byte ("eol_len", csv->eol_len);
- _cache_show_str ("eol", csv->eol_len, csv->eol);
+ _cache_show_str ("eol", csv->eol_len, csv->eol);
_cache_show_byte ("sep_len", csv->sep_len);
if (csv->sep_len > 1)
- _cache_show_str ("sep", csv->sep_len, csv->sep);
+ _cache_show_str ("sep", csv->sep_len, csv->sep);
_cache_show_byte ("quo_len", csv->quo_len);
if (csv->quo_len > 1)
_cache_show_str ("quote", csv->quo_len, csv->quo);
+ if (csv->types_len)
+ _cache_show_str ("types", csv->types_len, csv->types);
+ else
+ _cache_show_str ("types", 0, "");
+
+ if (csv->bptr)
+ _cache_show_str ("bptr", (int)strlen (csv->bptr), csv->bptr);
+ if (csv->tmp && SvPOK (csv->tmp)) {
+ char *s = SvPV_nolen (csv->tmp);
+ _cache_show_str ("tmp", (int)strlen (s), s);
+ }
} /* xs_cache_diag */
#define set_eol_is_cr(csv) cx_set_eol_is_cr (aTHX_ csv)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Text-CSV_XS-1.41/ChangeLog
new/Text-CSV_XS-1.43/ChangeLog
--- old/Text-CSV_XS-1.41/ChangeLog 2020-02-16 14:40:35.000000000 +0100
+++ new/Text-CSV_XS-1.43/ChangeLog 2020-05-27 08:45:30.000000000 +0200
@@ -1,3 +1,20 @@
+1.43 - 2020-05-27, H.Merijn Brand
+ * Add --parser-opt[=value] to csv-check
+ * Add -L & -X to csv-check
+ * Fix undef value in attribute setters for strings (issue 24)
+ * Document quote (undef) is not supported
+
+1.42 - 2020-05-19, H.Merijn Brand
+ * Update to Devel::PPPort-3.58
+ * Unicode fixes for csv2xls and csv2xlsx
+ * Add internal buffers to cache diagnostics
+ * Fix positional reporting in examples/csv-check
+ * Allow passing CSV parsing attributes to csv-check
+ * Proof reading - doc fixes by Klaus Baldermann <soonix> (PR#21)
+ * Fix type caching (RT#132344)
+ * Small doc fix by Nick Tonkin <1nickt> (PR#22)
+ * Fix sep=; being ignored in ->header (issue 23)
+
1.41 - 2020-02-16, H.Merijn Brand
* Update to Devel::PPPort-3.56
* csv2xls uses sheetname as csv2xlsx
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Text-CSV_XS-1.41/META.json
new/Text-CSV_XS-1.43/META.json
--- old/Text-CSV_XS-1.41/META.json 2020-02-16 14:40:39.000000000 +0100
+++ new/Text-CSV_XS-1.43/META.json 2020-05-27 10:01:52.000000000 +0200
@@ -1,42 +1,37 @@
{
+ "meta-spec" : {
+ "version" : 2,
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec"
+ },
"generated_by" : "Author",
- "version" : "1.41",
+ "release_status" : "stable",
+ "license" : [
+ "perl_5"
+ ],
"resources" : {
+ "x_IRC" : "irc://irc.perl.org/#csv",
"repository" : {
"web" : "https://github.com/Tux/Text-CSV_XS",
"url" : "https://github.com/Tux/Text-CSV_XS",
"type" : "git"
},
"homepage" : "https://metacpan.org/pod/Text::CSV_XS",
- "x_IRC" : "irc://irc.perl.org/#csv",
"license" : [
"http://dev.perl.org/licenses/"
]
},
- "name" : "Text-CSV_XS",
"abstract" : "Comma-Separated Values manipulation routines",
- "provides" : {
- "Text::CSV_XS" : {
- "file" : "CSV_XS.pm",
- "version" : "1.41"
- }
- },
- "author" : [
- "H.Merijn Brand <[email protected]>"
- ],
- "license" : [
- "perl_5"
- ],
+ "version" : "1.43",
"dynamic_config" : 1,
- "release_status" : "stable",
- "meta-spec" : {
- "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
- "version" : 2
- },
"prereqs" : {
- "configure" : {
+ "runtime" : {
"requires" : {
- "ExtUtils::MakeMaker" : "0"
+ "perl" : "5.006001",
+ "XSLoader" : "0",
+ "IO::Handle" : "0"
+ },
+ "recommends" : {
+ "Encode" : "3.06"
}
},
"build" : {
@@ -44,21 +39,26 @@
"Config" : "0"
}
},
- "test" : {
+ "configure" : {
"requires" : {
- "Test::More" : "0",
- "Tie::Scalar" : "0"
+ "ExtUtils::MakeMaker" : "0"
}
},
- "runtime" : {
- "recommends" : {
- "Encode" : "3.02"
- },
+ "test" : {
"requires" : {
- "IO::Handle" : "0",
- "XSLoader" : "0",
- "perl" : "5.006001"
+ "Tie::Scalar" : "0",
+ "Test::More" : "0"
}
}
+ },
+ "author" : [
+ "H.Merijn Brand <[email protected]>"
+ ],
+ "name" : "Text-CSV_XS",
+ "provides" : {
+ "Text::CSV_XS" : {
+ "file" : "CSV_XS.pm",
+ "version" : "1.43"
+ }
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Text-CSV_XS-1.41/META.yml
new/Text-CSV_XS-1.43/META.yml
--- old/Text-CSV_XS-1.41/META.yml 2020-02-16 14:40:39.000000000 +0100
+++ new/Text-CSV_XS-1.43/META.yml 2020-05-27 10:01:52.000000000 +0200
@@ -16,9 +16,9 @@
provides:
Text::CSV_XS:
file: CSV_XS.pm
- version: '1.41'
+ version: '1.43'
recommends:
- Encode: '3.02'
+ Encode: '3.06'
requires:
IO::Handle: 0
Test::More: 0
@@ -30,4 +30,4 @@
homepage: https://metacpan.org/pod/Text::CSV_XS
license: http://dev.perl.org/licenses/
repository: https://github.com/Tux/Text-CSV_XS
-version: '1.41'
+version: '1.43'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Text-CSV_XS-1.41/cpanfile
new/Text-CSV_XS-1.43/cpanfile
--- old/Text-CSV_XS-1.41/cpanfile 2020-02-16 14:40:39.000000000 +0100
+++ new/Text-CSV_XS-1.43/cpanfile 2020-05-27 10:01:52.000000000 +0200
@@ -1,7 +1,7 @@
requires "IO::Handle";
requires "XSLoader";
-recommends "Encode" => "3.02";
+recommends "Encode" => "3.06";
on "configure" => sub {
requires "ExtUtils::MakeMaker";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Text-CSV_XS-1.41/examples/csv-check
new/Text-CSV_XS-1.43/examples/csv-check
--- old/Text-CSV_XS-1.41/examples/csv-check 2020-01-30 14:05:14.000000000
+0100
+++ new/Text-CSV_XS-1.43/examples/csv-check 2020-05-21 10:40:11.000000000
+0200
@@ -1,7 +1,7 @@
#!/pro/bin/perl
# csv-check: Check validity of CSV file and report
-# (m)'20 [30 Jan 2020] Copyright H.M.Brand 2007-2020
+# (m)'20 [21 May 2020] Copyright H.M.Brand 2007-2020
# This code requires the defined-or feature and PerlIO
@@ -9,9 +9,9 @@
use warnings;
use Data::Peek;
-use Encode qw( decode );
+use Encode qw( decode encode );
-our $VERSION = "2.02"; # 2020-01-30
+our $VERSION = "2.05"; # 2020-05-21
my $cmd = $0; $cmd =~ s{.*/}{};
sub usage {
@@ -34,15 +34,20 @@
-f --skip-formula do not check formula's
--pp use Text::CSV_PP instead (cross-check)
+
+ -A a --attr=at:val pass attributes to parser
+ --at=val is also supported for know attributes
+ -L --list-attr list supported CSV attributes
+ -X --list-changes list attributes that changed from default
EOU
exit $err;
} # usage
-use Getopt::Long qw(:config bundling);
+use Getopt::Long qw(:config bundling passthrough);
my $eol;
GetOptions (
"help|?" => sub { usage (0); },
- "V|version" => sub { print "$cmd [$VERSION]\n"; exit 0; },
+ "V|version" => sub { say "$cmd [$VERSION]"; exit 0; },
"c|s|sep=s" => \(my $sep = ""),
"q|quo|quote=s" => \(my $quo = '"'),
@@ -58,10 +63,15 @@
"b|bom!" => \(my $opt_b = 0),
"f|skip-formula!" => \(my $opt_f = 0),
+ "A|attr=s" => \ my @opt_A,
+ "L|list-attr!" => \ my $opt_L,
+ "X|list-changes!" => \ my $opt_X,
+
"pp!" => \(my $opt_p = 0),
"v|verbose:1" => \(my $opt_v = 0),
) or usage (1);
+$opt_X and $opt_L++;
my $csvmod = "Text::CSV_XS";
if ($opt_p) {
@@ -73,10 +83,10 @@
}
$csvmod->import ();
+binmode STDOUT, ":encoding(utf-8)";
binmode STDERR, ":encoding(utf-8)";
my $fn = $ARGV[0] // "-";
-my $data = do { local $/; <> } or die "No data to analyze\n";
my @warn;
my %csvarg = (
@@ -89,6 +99,38 @@
auto_diag => 1,
formula => $opt_f ? "none" : "diag",
);
+{ my $p = $csvmod->new;
+ my %ka = map { $_ => $p->{$_} } grep m/^[a-z]/ => $p->known_attributes;
+ foreach my $i (reverse 0 .. $#ARGV) {
+ if ($ARGV[$i] =~ m/^--(no[-_])?+([-\w]+)(?:=(.*))?$/) {
+ my ($attr, $val) = (lc $2 =~ tr/-/_/r, $3 // ($1 ? 0 : 1));
+ if (exists $ka{$attr}) {
+ unshift @opt_A, "$attr:$val";
+ splice @ARGV, $i, 1;
+ }
+ }
+ }
+ for (@opt_A) {
+ m/^([-\w]+)(?:[:=](.*))?/ or next;
+ my ($attr, $val) = (lc $1 =~ tr/-/_/r, $2 // 1);
+ exists $ka{$attr} or next;
+ $val eq "undef" || !length $val and $val = undef; # -A
escape_char:
+ $csvarg{$attr} = $val;
+ }
+ if ($opt_L) {
+ $csvarg{sep_char} ||= $ka{sep_char};
+ foreach my $attr (sort keys %ka) {
+ $ka{$attr} //= "(undef)";
+ $csvarg{$attr} //= $ka{$attr};
+ $opt_X and $csvarg{$attr} eq $ka{$attr} and next;
+ printf " %-21s : %s\n", $attr, $csvarg{$attr};
+ }
+ exit 0;
+ }
+ }
+$opt_v > 1 and DDumper \%csvarg;
+
+my $data = do { local $/; <> } or die "No data to analyze\n";
my ($rows, %cols, $s_eol) = (0);
unless ($sep) { # No sep char passed, try to auto-detect;
@@ -106,6 +148,7 @@
}
my $csv = $csvmod->new (\%csvarg);
+$opt_v > 8 and DDumper $csv;
$bin = 0; # Assume ASCII only
@@ -119,7 +162,7 @@
eval { require Unicode::UCD; Unicode::UCD::UnicodeVersion () } ||
eval { require Module::CoreList;
$Module::CoreList::version{$cv}{Unicode} };
} || "unknown";
- print "Checked $file with $cmd $VERSION\nusing $csvmod
@{[$csvmod->VERSION]} with perl $pv and Unicode $uv\n";
+ say "Checked $file with $cmd $VERSION\nusing $csvmod @{[$csvmod->VERSION]}
with perl $pv and Unicode $uv";
my @diag = $csv->error_diag;
my $line = $. // $csv->record_number // "?";
if ($diag[0] == 2012 && $csv->eof) {
@@ -128,11 +171,11 @@
my $cols = @coll == 1 ? $coll[0] : "(@coll)";
$s_eol //= $csv->eol || "--unknown--";
$s_eol =~ m/[\x00-\x1f]/ and $s_eol = DDisplay $s_eol;
- print "OK: rows: $rows, columns: $cols\n";
- print " sep = <$sep>, quo = <$quo>, bin = <$bin>, eol = <$s_eol>\n";
- print " encoding = $csv->{ENCODING}\n" if $csv->{ENCODING};
+ say "OK: rows: $rows, columns: $cols";
+ say " sep = <$sep>, quo = <$quo>, bin = <$bin>, eol = <$s_eol>";
+ say " encoding = $csv->{ENCODING}" if $csv->{ENCODING};
if (@coll > 1) {
- print "multiple column lengths:\n";
+ say "multiple column lengths:";
printf " %6d line%s with %4d field%s\n",
$cols{$_}, $cols{$_} == 1 ? " " : "s",
$_, $_ == 1 ? "" : "s"
@@ -141,16 +184,48 @@
$diag[0] = 0;
}
elsif ($diag[2]) {
- print "$ARGV record $diag[3] at line $line/$diag[2] - $diag[0] -
$diag[1]\n";
+ say "$ARGV record $diag[3] at line $line/$diag[2] - $diag[0] -
$diag[1]";
my $ep = $diag[2] - 1; # diag[2] is 1-based
- my $err = $csv->error_input . " ";
- substr $err, $ep + 1, 0, "*";
- substr $err, $ep, 0, "*";
- ($err = substr $err, $ep - 5, 12) =~ s/ +$//;
- print " |$err|\n";
+ my $ei = $csv->error_input;
+ if (defined $ei) {
+ my $l = 0;
+ my $s = "";
+ eval { my $u = decode ("utf-8", $ei); $ei = $u };
+ for (split m/([^ -~])/ => $ei) {
+ if (m/^[ -~]+$/) {
+ $s .= $_;
+ $l += length;
+ next;
+ }
+ if ($_ eq "\t") {
+ $s .= "\\t";
+ $ep > $l and $ep++;
+ $l += 2;
+ next;
+ }
+ if ($_ eq "\n") {
+ $s .= "\\n";
+ $ep > $l and $ep++;
+ $l += 2;
+ next;
+ }
+ if ($_ eq "\r") {
+ $s .= "\\r";
+ $ep > $l and $ep++;
+ $l += 2;
+ next;
+ }
+ $s .= sprintf "\\x{%05x}", ord;
+ $ep > $l and $ep += 9 - length encode "utf-8", $_;
+ $l += 9;
+ }
+
+ say " |$s|"; # 2b06
+ say " |", " " x $ep, "\x{25b2}", " " x (length ($s) - $ep - 1),
"|";
+ }
}
else {
- print "$ARGV line $line - $diag[1]\n";
+ say "$ARGV line $line - $diag[1]";
}
print for @warn;
exit $diag[0];
@@ -164,7 +239,7 @@
my $r = shift;
$cols{scalar @$r}++;
grep { $_ & 0x0002 } $csv->meta_info and $bin = 1;
- $opt_v and show (@$r);
+ $opt_v > 2 and show (@$r);
if ($opt_u) {
my @r = @$r;
foreach my $x (0 .. $#r) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Text-CSV_XS-1.41/examples/csv2xls
new/Text-CSV_XS-1.43/examples/csv2xls
--- old/Text-CSV_XS-1.41/examples/csv2xls 2020-01-30 12:09:13.000000000
+0100
+++ new/Text-CSV_XS-1.43/examples/csv2xls 2020-03-25 10:10:07.000000000
+0100
@@ -1,12 +1,12 @@
#!/pro/bin/perl
# csv2xls: Convert csv to xls
-# (m)'19 [21 Oct 2019] Copyright H.M.Brand 2007-2020
+# (m)'20 [25 Mar 2020] Copyright H.M.Brand 2007-2020
use 5.12.0;
use warnings;
-our $VERSION = "1.79";
+our $VERSION = "1.80";
sub usage {
my $err = shift and select STDERR;
@@ -92,7 +92,7 @@
use Text::CSV_XS;
use Date::Calc qw( Delta_Days Days_in_Month );
use Spreadsheet::WriteExcel;
-use Encode qw( from_to );
+use Encode qw( from_to encode );
my $wbk = Spreadsheet::WriteExcel->new ($xls);
my $snm = $title;
@@ -175,6 +175,10 @@
$l > ($w[$c] // -1) and $w[$c] = $l;
if ($utf and $csv->is_binary ($c)) {
+ eval { # from_to requires raw
+ my $raw = encode ("UTF-8", $val, Encode::FB_CROAK);
+ $val = $raw;
+ };
from_to ($val, "utf-8", "ucs2");
$wks->write_unicode ($h, $c, $val);
next;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Text-CSV_XS-1.41/examples/csv2xlsx
new/Text-CSV_XS-1.43/examples/csv2xlsx
--- old/Text-CSV_XS-1.41/examples/csv2xlsx 2020-01-30 12:09:16.000000000
+0100
+++ new/Text-CSV_XS-1.43/examples/csv2xlsx 2020-03-25 09:52:09.000000000
+0100
@@ -1,12 +1,12 @@
#!/pro/bin/perl
# csv2xlsx: Convert csv to xlsx
-# (m)'19 [28 Nov 2019] Copyright H.M.Brand 2007-2020
+# (m)'20 [25 Mar 2020] Copyright H.M.Brand 2007-2020
use 5.14.0;
use warnings;
-our $VERSION = "1.06";
+our $VERSION = "1.07";
sub usage {
my $err = shift and select STDERR;
@@ -129,6 +129,7 @@
my $sheetname = $csvf =~ s{\.\w+$}{}ir =~ s{.*/}{}r || "Sheet 1";
($_ = length $sheetname) > 31 and substr $sheetname, 31, $_ - 31, "";
my $wks = $wbk->add_worksheet ($sheetname);
+ $utf && !$wks->can ("write_unicode") and $utf = 0;
if ($csvf =~ m/\.(png|jpe?g|bmp|gif|tiff|xpm)$/i) {
$wks->insert_image (1, 1, $csvf);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Text-CSV_XS-1.41/ppport.h
new/Text-CSV_XS-1.43/ppport.h
--- old/Text-CSV_XS-1.41/ppport.h 2020-02-13 17:36:46.000000000 +0100
+++ new/Text-CSV_XS-1.43/ppport.h 2020-03-10 08:34:58.000000000 +0100
@@ -4,7 +4,7 @@
/*
----------------------------------------------------------------------
- ppport.h -- Perl/Pollution/Portability Version 3.57
+ ppport.h -- Perl/Pollution/Portability Version 3.58
Automatically created by Devel::PPPort running under perl 5.030000.
@@ -21,7 +21,7 @@
=head1 NAME
-ppport.h - Perl/Pollution/Portability version 3.57
+ppport.h - Perl/Pollution/Portability version 3.58
=head1 SYNOPSIS
@@ -56,7 +56,7 @@
=head1 COMPATIBILITY
This version of F<ppport.h> is designed to support operation with Perl
-installations back to 5.003_07, and has been tested up to 5.31.6.
+installations back to 5.003_07, and has been tested up to 5.31.10.
=head1 OPTIONS
@@ -516,7 +516,7 @@
# Disable broken TRIE-optimization
BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if "$]" >= 5.009004 && "$]" <= 5.009005
}
-my $VERSION = 3.57;
+my $VERSION = 3.58;
my %opt = (
quiet => 0,
@@ -740,6 +740,7 @@
clone_params_new|5.013002|5.013002|nu
closest_cop|5.007002||Viu
cntrl_to_mnemonic|5.021004||ncViu
+compile_wildcard|5.031010||Viu
compute_EXACTish|5.017003||nViu
construct_ahocorasick_from_trie|5.021001||Viu
cop_fetch_label|5.015001|5.015001|x
@@ -801,9 +802,9 @@
croak_sv|5.013001|5.003007|p
croak_xs_usage|5.010001|5.003007|pn
cr_textfilter|5.006000||Viu
-csighandler1|||nu
-csighandler3|||nu
-csighandler|||nu
+csighandler1|5.031007|5.031007|nu
+csighandler3|5.031007|5.031007|nu
+csighandler|5.031007|5.031007|nu
current_re_engine|5.017001||cViu
curse|5.013009||Viu
custom_op_desc|5.007003|5.007003|d
@@ -1019,6 +1020,7 @@
eval_pv|5.006000|5.003007|p
eval_sv|5.006000|5.003007|p
exec_failed|5.009004||Viu
+execute_wildcard|5.031010||Viu
expect_number|5.007001||Viu
EXTEND|5.003007|5.003007|
EXTERN_C|5.005000|5.003007|poVu
@@ -1036,7 +1038,7 @@
find_beginning|5.005000||Viu
find_byclass|5.006000||Viu
find_default_stash|5.019004||Viu
-find_first_differing_byte_pos|||nViu
+find_first_differing_byte_pos|5.031007||nViu
find_hash_subscript|5.009004||Viu
find_in_my_stash|5.006001||Viu
find_lexical_cv|5.019001||Viu
@@ -1069,8 +1071,8 @@
force_word|5.003007||Viu
forget_pmop|5.017007||Viu
form|5.006000|5.004000|v
-form_alien_digit_msg|||ciu
-form_cp_too_large_msg|||ciu
+form_alien_digit_msg|5.031009||cViu
+form_cp_too_large_msg|5.031009||cViu
form_nocontext|5.006000||vnVu
fp_dup|5.007003|5.007003|u
fprintf_nocontext|5.006000||vndVu
@@ -1131,7 +1133,7 @@
G_RETHROW|5.031002|5.003007|p
grok_atoUV|5.021010||ncVi
grok_bin|5.007003|5.003007|p
-grok_bin_oct_hex|||cVu
+grok_bin_oct_hex|5.031008||cVu
grok_bslash_c|5.013001||cViu
grok_bslash_N|5.017003||Viu
grok_bslash_o|5.013003||cViu
@@ -1362,7 +1364,7 @@
invlist_iterinit|5.015001||nViu
invlist_iternext|5.015001||nViu
_invlist_len|5.017004||nViu
-invlist_lowest|||nxViu
+invlist_lowest|5.031007||nxViu
invlist_max|5.013010||nViu
invlist_previous_index|5.017004||nViu
invlist_replace_list_destroys_src|5.023009||Viu
@@ -1453,7 +1455,7 @@
isGCB|5.021009||Viu
isGRAPH|5.006000|5.003007|p
isGRAPH_A|5.013006|5.003007|p
-is_grapheme|||Viu
+is_grapheme|5.031007||Viu
isGRAPH_L1|5.013006|5.003007|p
isGRAPH_LC|5.006000|5.006000|
isGRAPH_LC_utf8_safe|5.025009|5.006000|p
@@ -1641,6 +1643,7 @@
LINKLIST|5.013006|5.013006|
list|5.003007||Viu
listkids|5.003007||Viu
+load_charnames|5.031010||cViu
load_module|5.006000|5.003007|pv
load_module_nocontext|5.006000||vnVu
localize|5.003007||Viu
@@ -1725,7 +1728,7 @@
maybe_multimagic_gv|5.019004||Viu
mayberelocate|5.015006||Viu
measure_struct|5.007003||Viu
-memCHRs||5.003007|p
+memCHRs|5.031008|5.003007|p
mem_collxfrm|5.003007||dViu
_mem_collxfrm|5.025002||Viu
memEQ|5.004000|5.003007|p
@@ -2026,7 +2029,7 @@
ORIGMARK|5.003007|5.003007|
OSNAME|5.003007|5.003007|
OSVERS|5.007002|5.007002|
-output_non_portable|||Viu
+output_non_portable|5.031008||Viu
output_posix_warnings|5.029005||Viu
package|5.003007||Viu
package_version|5.011001||Viu
@@ -2315,7 +2318,7 @@
PERL_USHORT_MAX|5.003007|5.003007|p
PERL_USHORT_MIN|5.003007|5.003007|p
PERL_VERSION|5.006000|5.003007|p
-perly_sighandler|||nu
+perly_sighandler|5.031007|5.031007|nu
pidgone|5.003007||Viu
PL_bufend||5.003007|pou
PL_bufptr||5.003007|pou
@@ -2456,13 +2459,13 @@
pv_uni_display|5.007003|5.007003|
qerror|5.006000||cViu
quadmath_format_needed|5.021004||nVi
-quadmath_format_valid|||nVi
+quadmath_format_valid|5.031007||nVi
RANDBITS|5.003007|5.003007|
READ_XDIGIT|5.017006|5.017006|
realloc|5.007002|5.007002|n
ReANY|||ncu
re_compile|5.009005|5.009005|u
-re_croak2|||iu
+re_croak|||iu
re_dup_guts|5.011000|5.011000|u
reentrant_free|5.010000|5.010000|u
reentrant_init|5.010000|5.010000|u
@@ -2525,6 +2528,7 @@
reg_numbered_buff_length|5.009005||cViu
reg_numbered_buff_store|5.009005||cViu
regpiece|5.005000||Viu
+regpnode|5.031010||Viu
regprop|5.003007||Viu
reg_qr_package|5.009005||cViu
regrepeat|5.005000||Viu
@@ -2540,6 +2544,7 @@
Renew|5.003007|5.003007|
Renewc|5.003007|5.003007|
re_op_compile|5.017001||Viu
+re_op_compile_wrapper|5.031010||Viu
repeatcpy|5.003007|5.003007|nu
REPLACEMENT_CHARACTER_UTF8|5.025005|5.003007|p
report_evil_fh|5.006001||Viu
@@ -2697,8 +2702,8 @@
SHORTSIZE|5.004000|5.004000|
should_warn_nl|5.021001||nViu
si_dup|5.007003|5.007003|u
-sighandler1|||nViu
-sighandler3|||nViu
+sighandler1|5.031007||nViu
+sighandler3|5.031007||nViu
sighandler|5.003007||nViu
simplify_sort|5.006000||Viu
SITELIB|5.003007|5.003007|
@@ -2889,7 +2894,7 @@
SvIOKp|5.003007|5.003007|
SvIOK_UV|5.006000|5.006000|
sv_isa|5.003007|5.003007|
-sv_isa_sv|||x
+sv_isa_sv|5.031007|5.031007|x
SvIsCOW|5.008003|5.008003|
SvIsCOW_shared_hash|5.008003|5.008003|
sv_isobject|5.003007|5.003007|
@@ -3275,7 +3280,7 @@
utf8n_to_uvchr_error|5.025006|5.025006|n
utf8n_to_uvchr_msgs|5.027009|5.027009|nx
_utf8n_to_uvchr_msgs_helper|5.029001||ncVu
-utf8n_to_uvuni|5.007001||cV
+utf8n_to_uvuni|5.007001||dcV
UTF8_SAFE_SKIP|5.029009|5.006000|p
UTF8SKIP|5.006000|5.006000|
UTF8_SKIP|5.023002|5.006000|p
@@ -3304,7 +3309,7 @@
UVTYPE|5.006000|5.003007|p
UVuf|5.006000|5.003007|p
uvuni_to_utf8|5.019004||cVu
-uvuni_to_utf8_flags|5.007003||cV
+uvuni_to_utf8_flags|5.007003||dcV
UVxf|5.006000|5.003007|p
UVXf|5.007001|5.007001|p
validate_proto|5.019002||xcVi
@@ -3350,7 +3355,7 @@
WARN_EXPERIMENTAL__BITWISE|5.021009|5.021009|
WARN_EXPERIMENTAL__CONST_ATTR|5.021008|5.021008|
WARN_EXPERIMENTAL__DECLARED_REFS|5.025003|5.025003|
-WARN_EXPERIMENTAL__ISA|||
+WARN_EXPERIMENTAL__ISA|5.031007|5.031007|
WARN_EXPERIMENTAL__LEXICAL_SUBS|5.017005|5.017005|
WARN_EXPERIMENTAL__POSTDEREF|5.019005|5.019005|
WARN_EXPERIMENTAL__PRIVATE_USE|5.029009|5.029009|
@@ -5209,6 +5214,18 @@
#endif
+#ifndef WIDEST_UTYPE
+# ifdef QUADKIND
+# ifdef U64TYPE
+# define WIDEST_UTYPE U64TYPE
+# else
+# define WIDEST_UTYPE unsigned Quad_t
+# endif
+# else
+# define WIDEST_UTYPE U32
+# endif
+#endif
+
/* These could become provided if/when they become part of the public API */
#ifndef withinCOUNT
# define withinCOUNT(c, l, n) \
@@ -5586,18 +5603,6 @@
#endif
-#ifndef WIDEST_UTYPE
-# ifdef QUADKIND
-# ifdef U64TYPE
-# define WIDEST_UTYPE U64TYPE
-# else
-# define WIDEST_UTYPE Quad_t
-# endif
-# else
-# define WIDEST_UTYPE U32
-# endif
-#endif
-
/* On versions without NATIVE_TO_ASCII, only ASCII is supported */
#if defined(EBCDIC) && defined(NATIVE_TO_ASCI)
#ifndef NATIVE_TO_LATIN1
@@ -10073,17 +10078,14 @@
#endif
#ifdef UVCHR_IS_INVARIANT
-# if 'A' == 65
-# ifdef QUADKIND
-# define D_PPP_UVCHR_SKIP_UPPER(c)
\
- (WIDEST_UTYPE) (c) <
\
- (((WIDEST_UTYPE) 1) << (6 * D_PPP_BYTE_INFO_BITS)) ? 7 : 13
-# else
-# define D_PPP_UVCHR_SKIP_UPPER(c) 7 /* 32 bit platform */
-# endif
-# else
- /* In the releases this is backported to, UTF-EBCDIC had a max of 2**31-1
*/
+# if 'A' != 65 || UVSIZE < 8
+ /* 32 bit platform, which includes UTF-EBCDIC on the releases this is
+ * backported to */
# define D_PPP_UVCHR_SKIP_UPPER(c) 7
+# else
+# define D_PPP_UVCHR_SKIP_UPPER(c) \
+ (((WIDEST_UTYPE) (c)) < \
+ (((WIDEST_UTYPE) 1) << (6 * D_PPP_BYTE_INFO_BITS)) ? 7 : 13)
# endif
#ifndef UVCHR_SKIP
# define UVCHR_SKIP(c) \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Text-CSV_XS-1.41/t/12_acc.t
new/Text-CSV_XS-1.43/t/12_acc.t
--- old/Text-CSV_XS-1.41/t/12_acc.t 2018-07-03 09:36:42.000000000 +0200
+++ new/Text-CSV_XS-1.43/t/12_acc.t 2020-05-26 17:53:16.000000000 +0200
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Test::More tests => 234;
+use Test::More tests => 238;
BEGIN {
use_ok "Text::CSV_XS";
@@ -53,6 +53,8 @@
is ($csv->sep (";"), ";", "sep (;)");
is ($csv->sep_char (), ";", "sep_char ()");
is ($csv->quote_char ("="), "=", "quote_char (=)");
+is ($csv->quote_char (undef), undef, "quote_char (undef)");
+is ($csv->{quote_char}, undef, "{quote_char}
(undef)");
is ($csv->quote (undef), "", "quote (undef)");
is ($csv->quote (""), "", "quote (undef)");
is ($csv->quote ("**"), "**", "quote (**)");
@@ -96,6 +98,8 @@
is ($csv->escape_null (1), 1, "escape_null (1)");
is ($csv->quote_null (1), 1, "quote_null (1)");
is ($csv->quote_binary (1), 1, "quote_binary (1)");
+is ($csv->escape_char (undef), undef, "escape_char (undef)");
+is ($csv->{escape_char}, undef, "{escape_char}
(undef)");
is ($csv->escape_char ("\\"), "\\", "escape_char (\\)");
ok ($csv->combine (@fld), "combine");
is ($csv->string,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Text-CSV_XS-1.41/t/80_diag.t
new/Text-CSV_XS-1.43/t/80_diag.t
--- old/Text-CSV_XS-1.41/t/80_diag.t 2020-01-31 13:31:02.000000000 +0100
+++ new/Text-CSV_XS-1.43/t/80_diag.t 2020-04-30 14:34:26.000000000 +0200
@@ -3,7 +3,7 @@
use strict;
use warnings;
- use Test::More tests => 333;
+ use Test::More tests => 334;
#use Test::More "no_plan";
my %err;
@@ -219,6 +219,7 @@
open EH, "<", $diag_file or die "STDERR: $!\n";
is (scalar <EH>, "CACHE:\n", "Title");
while (<EH>) {
+ m/^\s+(?:tmp|bptr)\b/ and next;
like ($_, qr{^ \w+\s+[0-9a-f]+:(?:".*"|\s*[0-9]+)$}, "Content");
}
close EH;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Text-CSV_XS-1.41/t/85_util.t
new/Text-CSV_XS-1.43/t/85_util.t
--- old/Text-CSV_XS-1.41/t/85_util.t 2019-06-24 10:32:57.000000000 +0200
+++ new/Text-CSV_XS-1.43/t/85_util.t 2020-05-20 15:34:56.000000000 +0200
@@ -14,7 +14,7 @@
plan skip_all => "This test unit requires perl-5.8.2 or higher";
}
else {
- my $n = 1446;
+ my $n = 1448;
$pu and $n -= 120;
plan tests => $n;
}
@@ -325,3 +325,13 @@
}
}
}
+
+{ # Header after first line with sep=
+ open my $fh, ">", $fnm or die "$fnm: $!";
+ print $fh "sep=;\n";
+ print $fh "a;b 1;c\n";
+ print $fh "1;2;3\n";
+ close $fh;
+ ok (my $aoh = csv (in => $fnm, munge => "db"), "Read header with sep=;");
+ is_deeply ($aoh, [{ a => 1, "b_1" => 2, c => 3 }], "Munged to db with
sep");
+ }