sub nested_lookup { my $node = shift; while (ref($node) and @_) { $node = $node->{ shift(@_) }; } return @_ ? undef : $node; }