well, if you want to see if you got mysql and perl working togather, try this stimple script I have. What it does is dumps three fields from the mysql.users table, which every mysql database has. Also, the script should tell you in the browser if there are any problems and what they are, thanks to Carp.


#!/usr/bin/perl

use CGI;
use CGI::Carp qw( fatalsToBrowser );
use DBI;

$myhost = 'localhost';
$myuser = 'root';
$mypass = '*******';

$mydb = 'mysql';

$q = new CGI;
print $q->header();
print $q->start_html;

$dbh = DBI->connect( "dbi:mysql:host=$myhost;database=$mydb", $myuser, $mypass, {
RaiseError => 1,
} );

$sth = $dbh->prepare( qq^
SELECT host, user, password
FROM user
^);
$sth->execute( );
$sth->bind_columns( \$host,
\$user,
\$password
);

print q^
Test mySQL and DBI
<p>
<table border = 1>
^;

while( $sth->fetch) {
print qq^<tr><td>$host</td><td>$user</td><td>$password</td></tr>^;
}
print q^
</table>
<p>
Everything executed as planned.
^;

print $q->end_html;



Note: its not a good idea to leave your password in code that you post up on a forum :-)