$menu[$level] = 0; #<- contains several hashes of individuals and their children as lists $menu[$level] = 1; #<- for each of those children, a new hash with their children as lists $menu[$level] = 2; #<- for each of those children, a new hash with their children as lists ... ...