my $var1; my $dbhandle = DBI->connect($DB_TYPE, $STAT_DB_USER, $STAT_DB_PASS, {RaiseError => 0}) or die "Database connection not made: $DBI::errstr"; my $sql = "SELECT * FROM parcel_out"; my $sth = $dbhandle->prepare($sql); $sth->execute(); foreach my $row ($sth->fetchrow_arrayref()){ print ".HIER\n"; $var1 = join("|",@row); print "$var1\n"; } print ".FERTIG\n"; $dbhandle->disconnect();