I generally use DBI as opposed to a specific DBI variant for database work. With that being said.
1) Where is $poemDB intialized at?
2) You never confirm database connection
3) Since you are only using 1 table from what I can see, why not directly connect to that db and table, as opposed to segregating into 2 lines?
4) You need to query the DB and return the results ala
#
# Syntax is off I know, but I want to make the point
# and allow the creator to find correct syntax as an
# exercise
#
$query = 'SELECT * from $table';
$ret = $dbh->execute($query);
for ( fetchrow($ret) ) {
print "$_\n";
}
5) I don't see you adding anything back into the DB, is this intentional or was the code left out?
Thats all I can see at first glance, but it should be enough to get you rolling forward with this.
On a side note maybe you should segregate this from a CGI and work a a strict command line level to get a feel for interfacing with the database, and work out the functionality you want/need first. That was you will have a better feel for how you want to present data to the client through the browser..
/* And the Creator, against his better judgement, wrote man.c */