#!/usr/bin/perl use strict; use warnings; use DBI; # Declare variables my $db = '/home/format_c/tmp/csvdb'; my $prefix = '+49'; # Makes a Datebase Handler my $dbh = DBI->connect("DBI:CSV:f_dir=$db") or die DBI::errstr; $dbh->{csv_tables}->{phonebook} = { file => 'Phonebook_SM.csv', #col_names => ["id", "nummer", "name"], eol => "\n", sep_char => ",", quote_char => '"', escape_cahar => '\\', }; my $sql = qq| SELECT * FROM phonebook |; my $sth = $dbh->prepare( $sql ) or die $dbh->errstr; $sth->execute() or die $dbh->errstr; while (my @row = $sth->fetchrow_array()) { printf "%s : %s : %s \n", @row; } $sth->finish(); $dbh->disconnect(); exit;