#!/usr/bin/perl use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); use DBI; use HTML::Entities; my $db_config_file = "db.cfg"; my %db_config = (); open CONFIG, ("< $db_config_file") or die "Konnte Datenbank Konfigurations Datei nicht öffnen! $!"; my @config_pairs = ; close CONFIG; foreach (@config_pairs) { chomp $_; my ($key, $value) = split/:/, $_; $db_config{$key} = $value; } my $database = $db_config{'database'}; my $db_server = $db_config{'db_server'}; my $db_user = $db_config{'db_user'}; my $db_pass = $db_config{'db_pass'}; my $dbh = DBI->connect("dbi:mysql:$database:$db_server", "$db_user", "$db_pass") or die "Konnte Datenbankverbindung nicht herstellen: $!";