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

I'm looking for a function/module which performs what DBI's selectall_hashref does when passed an array ref of keys.

In my case, I have 3 'keys' in an array of hash references and would like a 3-deep nested hashref produced.

scenario

I'm using Sybase::Simple but it only has a HashOfHashOfHash($sql, $key1, $key2) method. I need a method just like HashOfHashOfHash but which takes one more key.

So, my goal is to make a flat pull of my data as an array of hashrefs, and the use some module to nest it 3-deep.

Replies are listed 'Best First'.
Re: creating a nested hash from an array of hash refs
by metaperl (Curate) on Oct 22, 2009 at 16:41 UTC
    UPDATE: instead of deeply nesting SQL result sets and then using modules like Data::DPath, Data::Path, Data::Diver to grok the results in nested Perl loops, I need to learn to force the database to run loops for me by using labeled CASE statements!