my $dbh = DBI->connect("dbi:$db_type:$db_name", $db_username, $db_password, @_ ) or confess( "Could not connect to database\n" . $DBI::errstr ); sub confess { print "Content-Type: text/html\n\n" . shift }