Here is a simple script to test use of DBI, etc:
use DBI;
@driver_names = DBI->available_drivers;
print "@driver_names\n";
$DSN="DBI:mysql:database=test";
my $dbi=DBI->connect($DSN,"","") or die "Can't connect\n";
my $sth=$dbi->prepare("SHOW DATABASES");
$sth->execute();
$databases=$sth->fetchall_arrayref;
for(@$databases){print "@$_\n"}
$sth->finish();
$dbi->disconnect;
exit;
(You have to have mysql running first. Also, in the connect statement you may need to put the username and password; you can give the password as an argument to the script so you don't hardcode it in.)
chas