Package Info

perl-Module-Path


get the full path to a locally installed module


Development/Libraries/Perl

This module provides a single function, 'module_path()', which takes a module name and finds the first directory in your '@INC' path where the module is installed locally. It returns the full path to that file, resolving any symlinks. It is portable and only depends on core modules.

It works by looking in all the directories in '@INC' for an appropriately named file:

I wrote this module because I couldn't find an alternative which dealt with the points listed above, and didn't pull in what seemed like too many dependencies to me.

The distribution for 'Module::Path' includes the 'mpath' script, which lets you get the path for a module from the command-line:

% mpath Module::Path

The 'module_path()' function will also cope if the module name includes '.pm'; this means you can pass a partial path, such as used as the keys in '%INC':

module_path('Test/More.pm') eq $INC{'Test/More.pm'}

The above is the basis for one of the tests.


License: Artistic-1.0 or GPL-1.0+
URL: http://search.cpan.org/dist/Module-Path/

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.19-bp156.3.1 info GA Release 2023-07-22 15 SP6
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Module-Path
0.19-bp155.2.8 info GA Release 2023-05-17 15 SP5
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Module-Path
0.19-bp154.1.17 info GA Release 2022-05-09 15 SP4
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Module-Path
0.19-bp153.1.13 info GA Release 2021-03-06 15 SP3
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Module-Path
0.19-bp152.3.15 info GA Release 2020-04-16 15 SP2
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Module-Path
0.19-bp151.3.1 info GA Release 2019-07-16 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Module-Path
0.19-bp151.2.12 info GA Release 2019-05-18 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Module-Path
0.19-bp150.2.4 info GA Release 2018-07-30 15
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-Module-Path