#!/usr/local/bin/perl use strict; use lib qw( /webcontent/server_home/rentsavers/test ); $ENV{MOD_PERL} or die "not running mod_perl!: $! \n"; use Apache::Registry; use Apache::DBI (); use DBI (); # Initialize the database connections for each child Apache::DBI->connect_on_init ("DBI:mysql:database=test;host=localhost", "testuser", { PrintError => 1, # warn() on errors RaiseError => 0, # don't die on error AutoCommit => 1, # commit executes immediately } ); 1; #### package My::Greeting; use strict; use Apache::Constants qw(OK); use Data::Dumper; use DBI; sub handler { my $r = shift; my $now = scalar localtime; my $server_name = $r->server->server_hostname; $r->send_http_header('text/plain'); print <connect( "dbi:mysql:localhost", "rentsaver", "root" ) ; Dumper( $DBH ); return OK; } 1;