in reply to Re^3: Bad Text::CSV_XS parameter
in thread Bad Text::CSV_XS parameter

Thank you, you got it !
if I remove the BOM with vim, it works...

Thank you very much, even if I cannot use "detect_bom => 1" in this case as there is no header...

Replies are listed 'Best First'.
Re^5:Bad Text::CSV_XS parameter
by Tux (Canon) on Apr 24, 2020 at 20:52 UTC

    You can use header () even if your CSV does not have a header, if only to detect BOM, eol, and SEP.

    open my $fh, "<", "file.csv" or die "$!"; my $csv = Text::CSV_XS->new ({ binary => 1, auto_diag => 1 }); $csv->header ($fh, { bom => 1, set_column_names => 0 }); while (my $row = $csv->getline ($fh)) { # ... }

    Enjoy, Have FUN! H.Merijn
    A reply falls below the community's threshold of quality. You may see it by logging in.