=head1 METHODS
-=head2 _search_module_tree( type => TYPE, allow => \@regexex, [data => \@previous_results ] )
+=head2 _search_module_tree( type => TYPE, allow => \@regexes, [data => \@previous_results ] )
Searches the moduletree for module objects matching the criteria you
specify. Returns an array ref of module objects on success, and false
#
sub _search_module_tree {
+
my $self = shift;
my $conf = $self->configure_object;
my %hash = @_;
my($mods,$list,$verbose,$type);
my $tmpl = {
- data => { default => [values %{$self->module_tree}],
+ data => { default => [],
strict_type=> 1, store => \$mods },
allow => { required => 1, default => [ ], strict_type => 1,
store => \$list },
store => \$type },
};
- my $args = check( $tmpl, \%hash ) or return;
+ my $args = do {
+ ### don't check the template for sanity
+ ### -- we know it's good and saves a lot of performance
+ local $Params::Check::SANITY_CHECK_TEMPLATE = 0;
- { local $Params::Check::VERBOSE = 0;
+ check( $tmpl, \%hash );
+ } or return;
+
+ ### a list of module objects was supplied
+ if( @$mods ) {
+ local $Params::Check::VERBOSE = 0;
my @rv;
for my $mod (@$mods) {
}
return \@rv;
+
+ } else {
+ my @rv = $self->_source_search_module_tree(
+ allow => $list,
+ type => $type,
+ );
+ return \@rv;
}
}
my($authors,$list,$verbose,$type);
my $tmpl = {
- data => { default => [values %{$self->author_tree}],
+ data => { default => [],
strict_type=> 1, store => \$authors },
allow => { required => 1, default => [ ], strict_type => 1,
store => \$list },
my $args = check( $tmpl, \%hash ) or return;
- { local $Params::Check::VERBOSE = 0;
+ if( @$authors ) {
+ local $Params::Check::VERBOSE = 0;
my @rv;
for my $auth (@$authors) {
push @rv, $auth if allow( $auth->$type() => $list );
}
return \@rv;
+ } else {
+ my @rv = $self->_source_search_author_tree(
+ allow => $list,
+ type => $type,
+ );
+ return \@rv;
}
-
-
}
=pod