I've managed to connect to the database, but can't issue a query (and subsequently see its result). Here is the script:
-----
#! /usr/bin/perl
# carp
print "Content-type: text/html\n\n";
# declare mod usage
use DBI;
# connect to mysql db
$dbh = DBI->connect("DBI:mysql:$database:localhost", $user, $passwd);
print "connected.<br>";
# build query
$query = "select * from $table where 1";
print "query built.<br>";
# prep due to multirow result
$cursor = $dbh->prepare($query);
print "query prepared.<br>";
# commented out because above doesn't work
#$cursor->execute();
#print "query executed.<br>";
# clean up
$cursor->finish();
$dbh->disconnect();
----
and the output I get is:
"connected.
query built."
Apparently there is a problem with the prepare() statement, but I can't see anything wrong with it. Any help is appreciated.