in reply to Re: Getting Record Set via DBI into an Array of Arrays
in thread Getting Record Set via DBI into an Array of Arrays
Aside from the missing object in the method call, that creates an array element per row. The OP wants an array element per column.
I suppose you could fix it afterwards using something like
use Algorithm::Loops qw( MapCar ); my @data = MapCar { [ @_ ] } @{ $sth->fetchall_arrayref() };
Note that using selectall_arrayref saves you from calling execute and even prepare if you so desire.
use Algorithm::Loops qw( MapCar ); my @data = MapCar { [ @_ ] } @{ $dbh->selectall_arrayref($sth_or_sql) };
|
|---|