My first thought was to question whether INC needed to be a whole level in the name, but... upon consideration, yes, because it's the main point of the module.
Plus, there's precedence in Devel-INC-Sorted.

So my next thought is the third-level name. I'd drop the "My" and the "First" and just call it Devel-INC-Subrefs. Justification for dropping "My" being, well, whose else modules would you be wrapping; and justification for dropping "First" is that I could very well see an option for putting them in other positions as a
possibility (e.g., after=>"Games::*"), so why limit yourself?

    -john

On 10/6/2015 10:29 AM, David Cantrell wrote:
One of my modules is Sub::WrapPackages. It has a feature where you can invoke it once and it will both wrap itself around code that's already been loaded, but will also lurk in the background and do Things to code that is loaded in the future. It does this by dropping sub-refs in @INC. It also subverts 'use lib' so that if you 'use lib' after it has dropped its magic into @INC, it silently moves its sub-refs to the front of @INC.

The code for this is quite simple and right at the end of Sub::WrapPackages: https://metacpan.org/source/DCANTRELL/Sub-WrapPackages-2.0/lib/Sub/WrapPackages.pm#L337

I now find that I need this functionality in another module, so I'm going to rip it out and upload it to the CPAN as a seperate distribution that will let you register sub-refs to do this with. But what to call that?

Devel::INC::MySubrefsFirst?

I think that sucks, but I can't think of anything better that is still reasonably short. Anyone got any better suggestions?


Reply via email to