#!/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;csv_sep_char=,;") or die DBI::errstr; $dbh->{csv_tables}->{phonebook} = { file => 'Phonebook_SM.csv' }; 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()) { print join "\t",@row . "\n"; } $sth->finish(); $dbh->disconnect(); exit;