<%ARGS> $menu => 1 <%INIT> use vars qw($keeper); my $MENU = []; my $root = Contenido::Section->new($keeper,1); my @childs = $root->childs(); for (0..$#childs) { my $cid = $childs[$_]; my $child = Contenido::Section->new($keeper,$cid); if ($child->menu_A && ($menu == 1)) { push (@{ $MENU }, $child); }; if ($child->menu_B && ($menu == 2)) { push (@{ $MENU }, $child); }; } return $MENU;