sub root { my $self = shift; while ( defined ( my $parent = $self->{parent} ) ) { $self = $parent; } return $self; }