perl dbi fetchall array, but with column headers
Posted on 2012-08-28
Using Perl DBI, can anyone show me how to fetch all rows from a result set, but have the first row contain the column names?
Instead of [ [ row1data1,row1data2,...],[row2data1,row2data2,...] ] (which is what 'fetchall_arrayref()' returns)
I would like to have:
[ [column_name1,column_name2,...], [ row1data1,row1data2,...], [row2data1,row2data2,...] ]
Any scheme ideas would be welcome.