Re: convert linear array to nested structure

2015-08-07 Thread Simon Reinhardt
Am 04.08.2015 um 23:06 schrieb Brandon McCaig: > Generally I meant that your solution was short and simple enough that > it probably wasn't worth the extra effort of trying to improve it > [unless the code was going to be maintained for a long time]. This is > what I came up with in a few minutes.

Re: convert linear array to nested structure

2015-08-04 Thread Brandon McCaig
On Tue, Aug 4, 2015 at 5:06 PM, Brandon McCaig wrote: > my %prev = (1 => { kids => \@output }); Perhaps a more adequate identifier for this hash would have been %parents. *shrugs* Regards, -- Brandon McCaig Castopulence Software Blog

Re: convert linear array to nested structure

2015-08-04 Thread Brandon McCaig
On Sat, Aug 1, 2015 at 12:39 PM, Simon Reinhardt wrote: > Am 30.07.2015 um 20:42 schrieb Brandon McCaig: >> I'll give you my 2 cents for whatever that's worth. >:) > > Thanks for your many comments. > > The updated full project code is below. Feedback is appreciated. (you > also find this at git

Re: convert linear array to nested structure

2015-08-01 Thread Simon Reinhardt
Am 30.07.2015 um 20:42 schrieb Brandon McCaig: > I'll give you my 2 cents for whatever that's worth. >:) Thanks for your many comments. The updated full project code is below. Feedback is appreciated. (you also find this at github.com/simon0x5b/bookmark-djvu) > I can't help thinking that the e

Re: convert linear array to nested structure

2015-07-30 Thread Brandon McCaig
On Fri, Jul 24, 2015 at 03:05:24PM +0200, Simon Reinhardt wrote: > Am 21.07.2015 um 22:35 schrieb Jim Gibson: > > That is an unique data structure and transformation > > requirement (as most are), so you are not likely to find an > > existing set of code to do exactly what you want. However, > > th

Re: convert linear array to nested structure

2015-07-24 Thread Simon Reinhardt
Am 21.07.2015 um 22:35 schrieb Jim Gibson: > That is an unique data structure and transformation requirement (as most are), so you are not likely to find an existing set of code to do exactly what you want. However, the transformation should not be too difficult, so you should try to code up somet

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