in reply to Re^2: Array of Hashes to Hash of arrays for SQL::Abstract
in thread Array of Hashes to Hash of arrays for SQL::Abstract
I think you are right, in such circumstance I think I would use an index:
Something like:
for my $i (0..$#{$data}) { foreach ( keys %{$data->[$i]} ) { $columns->{$_}->[$i] = $data->[$i]->{$_} ; } ; }
Also makes it fairly easy to see what happens:
$columns->{$_}->[$i] = $data->[$i]->{$_} ; hash------^-------------------------^ array-----------^-------------^
|
|---|