use Class::Struct; struct child_t => { type => '$', }; struct parent_t => { type => '$', children => '$', };