use Text::CSV_XS; my $csv = Text::CSV_XS->new ({ binary => 1, auto_diag => 1, sep_char => "\t" }); open my $fh, "<:encoding(utf-8)", "test.txt" or die "test.txt: $!"; while (my $row = $csv->getline ($fh)) { # do something with @$row } close $fh;