in reply to List columns for a MySQL table
If you want to get the columns from a MySQL table (not an arbitrary query), it's simpler, as shown in DBI Recipes, to use selectcol_arrayref combined with describe.
my $col_names = $dbh->selectcol_arrayref( qq{describe $table} );
In Section
Cool Uses for Perl