$child = 2; $gks = @{$flat->{$flat->{$child}{children}[0]}{children}}; print join( ', ', @$gks ), "\n";