Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > perl.module-authors > #3249
| Newsgroups | perl.module-authors |
|---|---|
| Subject | Re: Naming help needed for evil @INC hackery |
| References | <5613E8F2.3010006@uk2group.com> |
| Message-ID | <5613F4FF.5020109@ripco.com> (permalink) |
| Date | 2015-10-06 11:21 -0500 |
| From | jgamble@ripco.com (John M Gamble) |
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?
>
Back to perl.module-authors | Previous | Next | Find similar
Re: Naming help needed for evil @INC hackery jgamble@ripco.com (John M Gamble) - 2015-10-06 11:21 -0500
csiph-web