http://qs321.pair.com?node_id=558309


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} );