Catmandu
view release on metacpan or search on metacpan
Revision history for Catmandu
1.2025 2025-07-07 11:23:47 CEST
- #403: Add support for BOM in CSV header ()
- Update project info and contact details
1.2024 2025-01-16 16:23:49 CET
- #402: Fix cli with Getopt::Long::Descriptive >= 0.116
1.2023 2025-01-12 18:37:51 CET
- Moving from List::MoreUtils to List::SomeUtils (obs. plicease)
1.2022 2024-09-29 21:03:06 CEST
- #399: removing smartmatch for perl 5.41.x support
t/Catmandu-Importer-CSV.t view on Meta::CPAN
$csv = <<EOF;
\xEF\xBB\xBF"name","age"
"Patrick","39"
"Nicolas","34"
EOF
$importer = $pkg->new(file => \$csv);
isa_ok $importer, $pkg;
is_deeply $importer->to_array, $data, 'CSV with header, BOM.';
$data = [{0 => 'Patrick', 1 => '39'}, {0 => 'Nicolas', 1 => '34'},];
$csv = <<EOF;
"Patrick","39"
"Nicolas","34"
EOF
$importer = $pkg->new(file => \$csv, header => 0);
t/Catmandu-Importer-CSV.t view on Meta::CPAN
is_deeply $importer->to_array, $data, 'CSV with header, separator is tab.';
$csv = <<EOF;
\xEF\xBB\xBF"name" "age"
"Nicolas" "34"
EOF
$importer = $pkg->new(file => \$csv, sep_char => '\t');
is_deeply $importer->to_array, $data, 'CSV with header, separator is tab, BOM.';
done_testing;
( run in 0.437 second using v1.01-cache-2.11-cpan-e9daa2b36ef )