Re: convert linear array to nested structure

2015-07-21 Thread Shawn H Corey
On Tue, 21 Jul 2015 13:35:37 -0700 Jim Gibson wrote: > The data structure you have shown is not very efficient in tems of > data storage. Is this the actual data structure, or is it part of > something more complicated. For exampe, a more efficient use of space > would be this, which uses nested

Re: convert linear array to nested structure

2015-07-21 Thread Jim Gibson
> On Jul 21, 2015, at 12:40 PM, Simon Reinhardt wrote: > > Hi Team, > > is there a ready solution to convert an linear array of hashrefs > like this > > [ {level => 0, value => "string1"}, > {level => 1, value => "string2"}, > {level => 2, value => "string3"}, > {level => 2, value => "strin

convert linear array to nested structure

2015-07-21 Thread Simon Reinhardt
Hi Team, is there a ready solution to convert an linear array of hashrefs like this [ {level => 0, value => "string1"}, {level => 1, value => "string2"}, {level => 2, value => "string3"}, {level => 2, value => "string4"} ] into the nested data structure [ {value => "string1", kids => [

Re: Display a hash in the order of an array

2015-07-21 Thread Vincent Lequertier
Le 2015-07-20 16:49, Charles DeRykus a écrit : On Mon, Jul 20, 2015 at 6:19 AM, Vincent Lequertier wrote: Thank you for the help, Charles! Unfortunately, I'm not able to figure out how to access the element of %ordered, despite some diggings in the perldoc (http://perldoc.perl.org/perldsc.htm