Skip Menu |

This queue is for tickets about the Module-Pluggable CPAN distribution.

Report information
The Basics
Id: 96432
Status: open
Priority: 0/
Queue: Module-Pluggable

People
Owner: Nobody in particular
Requestors: olaf [...] wundersolutions.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Wish list: define an exclusive set of search_dirs
Hi, Thanks very much for your work on this! I've got a situation where I'd like to find modules which are only in a certain search path. I can add the dirs to search_dirs, but the issue is that I _don't_ want all of @INC to be searched, because there may at times be some similarly named modules in @INC which I don't want to load. Would you be open to an option which would restrict the search to the supplied search_dirs rather than search_dirs + @INC? To be clear, I'm not asking to change the default behaviour of search_dirs, but to add this additional option. My use case would be in the Stepford module: https://metacpan.org/source/DROLSKY/Stepford-0.002002/lib/Stepford/Planner.pm#L294 Thanks very much, Olaf
I'll second this. I've been bitten by the current behaviour several times on various projects. Most recently by test failures like http://www.cpantesters.org/cpan/report/9daf34ec-263f-11e4-926c-83eadfbfc7aa The t/00-compile.t script is using Module::Pluggable to find all modules in the distro being tested so it can run require_ok() on them. The problem is that Module::Pluggable is finding not only the modules in the distro but also all *previously installed* modules in that namespace. I suggest a search_dirs_exclusively => 1 option to indicate that search_dirs is exclusive (like search_path is).
Note the 'BEHAVIOUR UNDER TEST ENVIRONMENT' doesn't apply because the tests get run like this: $ make test PERL_DL_NONLAZY=1 /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t In this case the blib module is not loaded so the magical blib/ behaviour isn't triggered.
Meanwhile, for my immediate needs, I've switched to https://metacpan.org/pod/Test::Compile