use Text::CSV_XS; my $csv = Text::CSV_XS->new(binary=>1); ...