use DBI my $dbh = DBI->connect ("dbi:CSV:", undef, undef, { f_ext => ".txt/r", f_encoding => "utf-8", csv_sep_char => "\t", # more options available RaiseError => 1, }); my $sth = $dbh->prepare ("select * from test"); $sth->execute; while (my @row = $sth->fetrow_array) { # do something with the fields }