use Text::CSV_XS; # or use Text::CSV; my $csv = Text::CSV_XS->new ({ binary => 1, auto_diag => 1 });