SYNOPSIS

     use Module::Path::More qw(module_path pod_path);
    
     $path = module_path(module=>'Test::More');
     if (defined($path)) {
       print "Test::More found at $path\n";
     } else {
       print "Danger Will Robinson!\n";
     }
    
     # find all found modules, as well as .pmc and .pod files
     $paths = module_path(module=>'Foo::Bar', all=>1, find_pmc=>1, find_pod=>1);
    
     # just a shortcut for module_path(module=>'Foo',
     #                                 find_pm=>0, find_pmc=>0, find_pod=>1);
     $path = pod_path(module=>'Foo');

DESCRIPTION

    Module::Path::More provides a function, module_path(), which will find
    where a module (or module prefix, or .pod file) is installed locally.
    (There is also another function pod_path() which is just a convenience
    wrapper.)

    It works by looking in all the directories in @INC for an appropriately
    named file. If module is Foo::Bar, will search for Foo/Bar.pm,
    Foo/Bar.pmc (if find_pmc argument is true), Foo/Bar directory (if
    find_prefix argument is true), or Foo/Bar.pod (if find_pod argument is
    true).

    Caveats: Obviously this only works where the module you're after has
    its own .pm file. If a file defines multiple packages, this won't work.
    This also won't find any modules that are being loaded in some special
    way, for example using a code reference in @INC, as described in
    require in perlfunc.

    To check whether a module is available/loadable, it's generally better
    to use something like:

     if (eval { require Some::Module; 1 }) {
         # module is available
     }

    because this works with fatpacking or any other @INC hook that might be
    installed. If you use:

     if (module_path(module => "Some::Module")) {
         # module is available
     }

    then it only works if the module is locatable in the filesystem. But on
    the other hand this method can avoid actual loading of the module.

SEE ALSO

    Module::Path. Module::Path::More is actually a fork of Module::Path.
    Module::Path::More contains features that are not (or have not been
    accepted) in the original module, namely: finding all matches instead
    of the first found match, and finding .pmc/.pod in addition to .pm
    files. Note that the interface is different (Module::Path::More accepts
    hash/named arguments) so the two modules are not drop-in replacements
    for each other. Also, note that by default Module::Path::More does not
    do an abs_path() to each file it finds. I think this module's choice
    (not doing abs_path) is a more sensible default, because usually there
    is no actual need to do so and doing abs_path() or resolving symlinks
    will sometimes fail or expose filesystem quirks that we might not want
    to deal with at all. However, if you want to do abs_path, you can do so
    by setting abs option to true.

    Command-line utility is not included in this distribution, unlike mpath
    in Module-Path. However, you can use pmpath
    <https://metacpan.org/pod/distribution/App-PMUtils/bin/pmpath> from
    App::PMUtils distribution which uses this module.

    References:

      * https://github.com/neilbowers/Module-Path/issues/6

      * https://github.com/neilbowers/Module-Path/issues/7

      * https://github.com/neilbowers/Module-Path/issues/10

      * https://rt.cpan.org/Public/Bug/Display.html?id=100979