Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: Array of Hashes to Hash of arrays for SQL::Abstract

by Veltro (Hermit)
on Mar 18, 2020 at 16:27 UTC ( [id://11114435]=note: print w/replies, xml ) Need Help??


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-----------^-------------^

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11114435]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-25 14:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found