Help for this page
use List::MoreUtils qw(all); ... last if all { $_->has_ancestor($ancestor) } @rest; $ancestor = $ancestor->get_parent; }