NAME

Module::Finder - find and query modules in @INC and/or elsewhere

SYNOPSIS

use Module::Finder;
my $finder = Module::Finder->new(
  dirs => ['/usr/local/junk/', '/junk/', @INC],
  paths => {
    'Module::Name::Prefix' => '-',   # no recursion - just *.pm
    'This::Path'           => '-/-', # only This/Path/*/*.pm
    'My'                   => '*',   # everything below My/
  },
);

# dirs searches @INC only if it is blank

# the first request will cache search results
my @modnames = $finder->modules;

my @modinfos = $finder->module_infos;

my $info = $finder->module_info('My::Found');

# if you're creating/installing code, you might want to rescan
$finder->reset;

new

my $finder = Module::Finder->new(%args);
globs

This isn't the same as shell glob syntax. These globs say how deep (or not) you want to look in a given path and whether you want to pickup modules that appear along the way. A list of shell glob equivalents follows each one.

/      just recurse              (*, */*, */*/*, ...)
+      just this directory       (*)
-/+    only one level down       (*/*)
-/-/+  two levels down           (*/*/*)
-/+/+  one and two levels down   (*/*, */*/*)
+/+/+  zero thru two levels down (*, */*, */*/*)

If the glob spec is more that just "+", the trailing plus (which is required to make sense) may be omitted (e.g. '-/+' and '-/' are equivalent.)

_find

$finder->_find;

_which_dirs

my @dirs = $self->_which_dirs;

_glob_parse

my $glob = $self->_glob_parse($glob);

reset

$finder->reset;

modules

my @modnames = $finder->modules;

module_infos

Returns the info for the first hit of every found module.

my %modinfos = $finder->module_infos;

all_module_infos

Returns the info for all hits of every found module. Each element of the returned hash will be an array ref with one or more info objects.

my %modinfos = $finder->all_module_infos;

module_info

my $info = $finder->module_info('My::Found');

all_module_info

my @info = $finder->all_module_info('My::Found');

AUTHOR

Eric Wilhelm <ewilhelm at cpan dot org>

http://scratchcomputing.com/

BUGS

If you found this module on CPAN, please report any bugs or feature requests through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

If you pulled this development version from my /svn/, please contact me directly.

COPYRIGHT

Copyright (C) 2006 Eric L. Wilhelm, All Rights Reserved.

NO WARRANTY

Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatseover. You have been warned.

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

This module is inspired and/or informed by the following. Maybe they do what you want.

File::Find
File::Finder
Module::Find
Module::Require
Module::Locate
Module::Pluggable::Object
Module::List