rovf has asked for the wisdom of the Perl Monks concerning the following question:

What is the best way to specify for cpan shell the directory/-ies where the files are downloaded, built and installed? Occasionally I want to try out something with cpan, and I don't want my Perl installation to be touched, so I'm thinking of writing a shell/batch script cpan_test which just puts all the files in a different directory than usual.

For instance, are there environment variables which have such an effect? I checked the perldocs, but didn't find anything which would help me here.

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re: Specifying directories for cpan shell
by jakobi (Pilgrim) on Oct 06, 2009 at 10:14 UTC

    one option is to check ~/.cpan or ~/.cpanplus. E.g. ~/.cpan/CPAN/MyConfig.pm: CPAN.pm does manage this file, but I had to manually add e.g. a sudo there a while ago (_one_ of build or install), as I couldn't use CPAN.pm itself to modify that value. In mine there's e.g. an INSTALLDIRS=site option value being set.

    HTH, Peter

      one option is to check ~/.cpan
      Thanks a lot. Do you also happen to know what's the path is on Windoze?

      -- 
      Ronald Fischer <ynnor@mm.st>
Re: Specifying directories for cpan shell
by Anonymous Monk on Oct 06, 2009 at 10:27 UTC
Re: Specifying directories for cpan shell
by JavaFan (Canon) on Oct 06, 2009 at 10:22 UTC
    You could just instruct cpan to build the module you want to test, then do your trying using the directory cpan build it in (typically ~/.cpan/build/Distro-Name-Version.hash/blib).