- or download this
my $input = {
'Sally Smith' => { parents => ['Bob Smith', 'Rhonda Smith']},
...
'Betty Boop' => { parents => ['Rhonda Smith', 'Louis McFern']},
'Jim Morris' => { parents => ['Betty Boop', 'John Wayne']},
};
- or download this
my $people = {};
for my $m (keys %$input) {
...
ref($params{$par}) eq "ARRAY" ? @{$params{$par}} : $params
+{$par};
}
}
- or download this
{
"Betty Boop" => { children => ["Jim Morris"], parents => ["Rhond
+a Smith", "Louis McFern"], },
...
"Rhonda Smith" => { children => ["Sally Smith", "Betty Boop"], pare
+nts => [] },
"Sally Smith" => { children => [], parents => ["Bob Smith", "Rhond
+a Smith"] },
}
- or download this
for my $top_level (sort keys %$people) {
next if @{ $people->{$top_level}{parents} };
...
print_level($people,$child,$level+1);
}
}
- or download this
Bob Smith
Sally Smith
...
Sally Smith
Betty Boop
Jim Morris