Help for this page
$flat = { 0 => { 'parents' => undef, 'children' => [2,3,5] }, ... 350 => { 'parents' => [35,50], 'children' => undef }, 500 => { 'parents' => [50], 'children' => undef }, };
$child = 2; $gks = @{$flat->{$flat->{$child}{children}[0]}{children}}; print join( ', ', @$gks ), "\n";