Check out
locate DBI
...
/usr/lib/perl5/DBI
...


And see if this helps
#!/usr/bin/perl -w
print "Content-type:text/html\n\n";
use CGI qw(:standard);
#use Fcntl qw(:flock);

# for DB
use DBI;

# connecting to the mysql server running on the web server.
# you need to specify your own server.
my $sqlhost = "localhost";

my $database = "test";
my $user = "root";
my $password = "your_password";

print "connecting to $sqlhost...";

my $dbh = DBI->connect("DBI:mysql:$database:$sqlhost", $user, $password) or die "Can't connect to MySql server at $sqlhost\n";

print "succeeded.\n";
$dbh->disconnect;