#!perl use strict; use warnings; use open qw( :encoding(UTF-8) :std ); use Text::CSV_XS; my $csv = Text::CSV_XS->new({ always_quote => 1, binary => 1, eol => $/, }); while (my $fields = $csv->getline(*ARGV)) { $csv->print(\*STDOUT, $fields); } $csv->eof() or $csv->error_diag(); exit 0;