metaperl has asked for the wisdom of the Perl Monks concerning the following question:
That I want to reformat with an arbitrary key.. let's say 'people_id':[ { 'time_of_request' => '2009-03-12 16:07:13', 'runmode' => 'authen_dummy_redirect', 'people_id' => '6877' }, { 'time_of_request' => '2009-03-12 16:07:14', 'runmode' => 'affiliates', 'people_id' => '6877' }, { 'time_of_request' => '2009-03-12 16:24:25', 'runmode' => 'affiliates', 'people_id' => '6877' }, { 'time_of_request' => '2009-03-12 16:24:45', 'runmode' => 'agents', 'people_id' => '6877' } ];
I know that I could write something to do this, but was hoping for a CPAN goodie, the functional inverse of Data::Hash::Flatten.{ 6877 => [ { 'time_of_request' => '2009-03-12 16:07:14', 'runmode' => 'affiliates', }, { 'time_of_request' => '2009-03-12 16:24:25', 'runmode' => 'affiliates', }, { 'time_of_request' => '2009-03-12 16:24:45', 'runmode' => 'agents', } ] 4211 => [ ... ], }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: remapping an arrayref of hashrefs to a hashref of array refs
by ikegami (Patriarch) on Mar 12, 2009 at 20:56 UTC | |
|
Re: remapping an arrayref of hashrefs to a hashref of array refs
by BrowserUk (Patriarch) on Mar 12, 2009 at 21:20 UTC | |
by metaperl (Curate) on Mar 13, 2009 at 12:41 UTC | |
by BrowserUk (Patriarch) on Mar 13, 2009 at 13:36 UTC | |
by metaperl (Curate) on Mar 13, 2009 at 12:44 UTC | |
by BrowserUk (Patriarch) on Mar 13, 2009 at 13:38 UTC | |
|
Re: remapping an arrayref of hashrefs to a hashref of array refs
by ig (Vicar) on Mar 12, 2009 at 21:06 UTC |