#!/usr/bin/perl use strict; use warnings; use Text::CSV; use DBI; my $dbh = DBI->connect('DBI:mysql:db;host=xx.stratoserver.net', 'xx', 'xx', { RaiseError => 1 } ); $dbh->disconnect(); print "CSV Vergleich vom 06.10.2011\n"; my@rows; my $csv = Text::CSV->new ( { binary => 1 , sep_char => ";" } ) or die "File not found: ".Text::CSV->error_diag (); open my $fh, "<:encoding(ISO-8859-15)", "xt_customers.csv" or die "xt_customers.csv $!"; while ( my $row = $csv->getline ( $fh ) ) { my @members_of_the_row = @$row; # print @members_of_the_row; # print "\n"; print $row->[0], "\n" # Baustelle my $statement = $dbh->prepare('SELECT * FROM xt_customers WHERE customers_id = ?'); my @db_row = $statement->fetchrow; if (@db_row) { print "Den Kunden $kundennummer gibt es\n" } # Baustelle } $csv->eof or $csv->error_diag(); close $fh;