#! /usr/bin/perl use warnings; use strict; use Text::CSV; # generate XML from CSV files # my $csv = Text::CSV->new( { binary => 1, # binary for utf8, latin1 etc sep_char => "\t" } ) or die "Cannot use CSV: ".Text::CSV->error_diag (); $csv->eol("\r\n"); binmode(STDIN, ":utf8"); binmode(STDOUT, ":utf8"); foreach (@ARGV) { open my $input, "<:encoding(utf8)", $_ or die "test.csv: $!"; print ""; while (my $colref = $csv->getline($input)) { print "" . join("", map { "$_" } @$colref ) . "\n"; } print "\n"; }