for my $i (0..$#{$data}) { foreach ( keys %{$data->[$i]} ) { $columns->{$_}->[$i] = $data->[$i]->{$_} ; } ; }