A configuration file is any module with a name starting with "CPANPLUS/Config/", relative to the current base directory (by default: $home/.cpanplus on a linux system) or any folder in @INC.

Thanks a lot, works.

But what is interesting (strace-d), if any such module is found in @INC, the same module is also being loaded from $HOME/.cpanplus first, so the one found in @INC has no effect. A bug? A feature?

What is also important, make sure that the package in which the configuration is defined matches the filename, or the configuration will be ignored (possibly with some errors on the console). Seems normal, but may be missed when copying the saved User.pm file to e.g. SomeLocal.pm without changing the package name.

So to sum up with some code, I use custom cpanp configuration for local dir "installations" by starting it in a directory having CPANPLUS/Config/SomeLocal.pm:

package CPANPLUS::Config::SomeLocal; use warnings; use strict; use Cwd; sub setup { my $conf = shift; my $d = getcwd; $conf->set_conf( base => "$d/.cpanplus" ); $conf->set_conf( buildflags => "install_base=$d/perl" ); $conf->set_conf( makemakerflags => "INSTALL_BASE=$d/perl" ); return 1; } 1;

In reply to Re^2: CPANPLUS custom configurations by przemo
in thread CPANPLUS custom configurations by przemo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.