http://www.perlmonks.org?node_id=853842

avrono has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I currently populate an array with hard coded column names like so (when doing a DBI query)... while (my @data = $sth->fetchrow_array()) { push(@result, { someCol => $data[0], someCol2 => $data1, }); } Is it possible to get the same result, however have the col_names pulled from the DB ? Also Could I do that with bind_columns ? I was trying something like this : $sth->bind_columns(\@result{@{$sth->{NAME_lc}}}); while ($sth->fetch) { push(@resultSet, \@result); } But can`t seem to dereference the array later, any ideas ?