in reply to So you think you're good with structures?

The first thing I see is the wasted use of nested references for the children. It'd be far easier to just keep an array reference:
my $rdb={ 'table a' => { 'aa' => { children => { 'table b' => [ 'ab' ], 'table c' => [ 'ac' ], } }, }, };
Like so. I think that will make the general approach far easier.

_____________________________________________________
Jeff japhy Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re: Re: So you think you're good with structures?
by clintp (Curate) on Aug 03, 2001 at 22:50 UTC
    I think one of the original incarnations of the structure looked like this. It doesn't change the approach at all. If you want just the keys, the use: keys %{....} instead of @{...} when you get down there. The references are there just because they were there when it was built, you don't have to use them.

    Obviously, the structure wasn't BUILT with code like this. This was taken out of a 600-line program that did a lot of other things.