in reply to Field names from DBI?

To get the table field names you can do the following
my $sth = $dbh->prepare("SELECT * FROM $tablename WHERE 1=0"); $sth->execute(); my $fields = $sth->{NAME};
$dbh should be your connected DB handle
$fields will be an arrayref of the fieldnames
You can also look at the table_info method but check the docs for your DBD driver to see if its supported