#!/usr/bin/perl use CGI qw/:standard/; use DBI; use Data::Dumper; $Apache::DBI::DEBUG = 2; # Turn on Apache::DBI debugging print header, start_html('Testing Apache::DBI'), h1('Testing Apache::DBI'); my $dbh; eval { $dbh = DBI->connect( "DBI:mysql:database=test;host=localhost", undef, undef, { RaiseError => 1 } ) ; }; if ($@) { print p('DBI Error: '.$@); } else { print p('Connect success'); print p("We are using Apache::DBI") if $dbh->isa('Apache::DBI::db'); print pre(Dumper($dbh)); } print end_html();