I’m confused, I think Tim is trying to show bad Perl code, but it looks perfectly clear to me. (and no, I’m not a “Perl god”).

Ok, well $parents being undefined is a little confusing, but we can assume that gets initialized off stage. (actually seeing how $parents gets initialized could be the most interesting part of the code, recursive walk ups, are tricky in any language)