Thopilt has asked for the wisdom of the Perl Monks concerning the following question:
Well, no luck with chatterbox, so I guess I ask it here.
When building perl (I'm actually installing with plenv), how do I remove curdir (i.e., ".") from the default @INC? I don't mean no lib "." or anything like that, I mean perl -V shouldn't show it at the bottom.
You can stop reading here unless you like other people's whining.
For some reason, I can't make DDG or any other search engine return anything except how to add things to @INC at run time. Is that really a thing people don't know how to do? It's in the FAQ for Wall's sake! If you want to *add* directories during Configure http://search.cpan.org/perldoc/INSTALL tells you all about it and a million other things. Yet not a word on *removing* directories.
Why is curdir even included in the default @INC in the first place? How often is your cwd a perl library root! I'm thinking... approximately never. It seems like a security risk to me. It definitely messes up plenv list-modules (i.e., ExtUtils::Installed->new->modules()), which now has to look through whatever your cwd is and all it's descendants for .packlist files. Even if you happen to be located in a directory with thousands of subdirectories and millions of files: "YTF is this list-modules command not returning instantly whenever I'm on my NAS NFS mount?!?" Even if you're in a project directory with multiple local::lib installs: "YTF is list-modules telling me every module in every project is installed, when none of them are installed at this level?!?" Even if you're in $HOME (where plenv lives): "YTF is list-modules telling me every module I've installed for *any* version of perl is installed for *every* version of perl I have?!?"
Ridiculous. Yet I can't find anyone else having this issue because search engines only want to tell me about adding to @INC at runtime. Sigh. I even looked through the Configure script and couldn't find anything about leaving out directories. Hopefully some monk knows the answer. Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Configuring default @INC
by syphilis (Archbishop) on Mar 01, 2017 at 01:30 UTC | |
by Thopilt (Initiate) on Mar 01, 2017 at 02:38 UTC | |
by syphilis (Archbishop) on Mar 01, 2017 at 04:40 UTC | |
|
Re: Configuring default @INC
by stevieb (Canon) on Mar 01, 2017 at 00:26 UTC | |
|
Re: Configuring default @INC
by 1nickt (Canon) on Mar 01, 2017 at 01:41 UTC | |
|
Re: Configuring default @INC
by Anonymous Monk on Mar 01, 2017 at 01:14 UTC | |
by Anonymous Monk on Mar 01, 2017 at 01:24 UTC | |
by Thopilt (Initiate) on Mar 01, 2017 at 02:40 UTC | |
by Corion (Patriarch) on Mar 01, 2017 at 08:29 UTC | |
by Anonymous Monk on Mar 01, 2017 at 04:01 UTC | |
by syphilis (Archbishop) on Mar 01, 2017 at 10:52 UTC | |
|
Re: Configuring default @INC
by ikegami (Patriarch) on Mar 01, 2017 at 17:39 UTC | |
|
Re: Configuring default @INC
by Anonymous Monk on Mar 01, 2017 at 21:58 UTC |