Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > perl.module-authors > #3249

Re: Naming help needed for evil @INC hackery

Newsgroups perl.module-authors
Path csiph.com!xmission!news.glorb.com!usenet.stanford.edu!nntp.perl.org
Xref csiph.com perl.module-authors:3249
Return-Path <jgamble@ripco.com>
Mailing-List contact module-authors-help@perl.org; run by ezmlm
Delivered-To mailing list module-authors@perl.org
Received (qmail 31639 invoked from network); 6 Oct 2015 16:21:34 -0000
Received from x1.develooper.com (207.171.7.70) by x6.develooper.com with SMTP; 6 Oct 2015 16:21:34 -0000
Received (qmail 7851 invoked by uid 225); 6 Oct 2015 16:21:33 -0000
Delivered-To module-authors@perl.org
Received (qmail 7847 invoked by alias); 6 Oct 2015 16:21:33 -0000
X-Spam-Status No, hits=-2.6 required=8.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By la.mx.develooper.com
Received from zone1.ripco.com (HELO zone1.ripco.com) (66.251.253.171) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Tue, 06 Oct 2015 09:21:27 -0700
Received from [192.168.11.13] (adsl-99-135-194-212.dsl.chcgil.sbcglobal.net [99.135.194.212]) (authenticated bits=0) by zone1.ripco.com (8.14.9/8.14.9) with ESMTP id t96GLH1s000435 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for <module-authors@perl.org>; Tue, 6 Oct 2015 11:21:22 -0500 (CDT)
Subject Re: Naming help needed for evil @INC hackery
To module-authors@perl.org
References <5613E8F2.3010006@uk2group.com>
Message-ID <5613F4FF.5020109@ripco.com> (permalink)
Date Tue, 6 Oct 2015 11:21:19 -0500
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
MIME-Version 1.0
In-Reply-To <5613E8F2.3010006@uk2group.com>
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
Approved news@nntp.perl.org
From jgamble@ripco.com (John M Gamble)

Show key headers only | View raw


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


Thread

Re: Naming help needed for evil @INC hackery jgamble@ripco.com (John M Gamble) - 2015-10-06 11:21 -0500

csiph-web