New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add `dirs` option to `module_path()` #27

Open
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
1 participant
@paultcochrane
Contributor

paultcochrane commented Jul 29, 2016

As requested in issue #17, this PR extends Module::Path to search in a list of user-supplied directories.

I'm not yet 100% satisfied with the implementation, so consider this PR something for discussion and as an attempt at getting the implementation right. I have the feeling that if one supplies a list of directories and searches therein, then one already knows where the module is and doesn't need special code to do this, however I'm probably not thinking about all possible use cases. The implementation specifically doesn't search in @INC, only in the supplied list of directories. If, however, the required behaviour is that one should search in @INC and the supplied list of dirs, then just let me know and I'll update the code.

Please also review the code wrt your coding standards/style. I've formatted the code using standard perltidy however you might like something different. I also tend to wrap my tests into blocks of subtests; if this isn't how you like things, just let me know and I'll update the PR. Any feedback (technical, style, etc) is more than welcome!

paultcochrane added some commits Jul 29, 2016

Add 'dirs' option to module_path()
As requested in issue #17, being able to search in a list of user-supplied
directories instead of just in `@inc` would be helpful.  This implements the
functionality in the main module and updates the POD and tests appropriately.
Update mpath to accept the --dirs option
... which then allows the user to specify a list of directories in which to
search for modules.  The POD and the tests for `mpath` have been updated so
that the new functionality is documented and checked for correctness.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment