in reply to Field names of database table from DBI

I know this is off topic (slightly), but if you're interested in simplicity, you can save typing || die $dbh->errstr; every time by adding to your DBI->connect.
my $dbh = DBI->connect("database","user","password","mysql", { RaiseEr +ror => 1 });
The RaiseError flag will take care of that for you.
There are other ways of getting the field names, but I'm not for certain that it is always supported.

InfinityandBeyond