title: Trying to force CPAN to install in specific directory for Strawberry Perl
body: <p>I have a strawberry perl installation (v. 5.16.3) on a windows production box.  I assume that many moons ago, somebody installed it on the C: drive and then just moved it to D:.  I don't know, I wasn't there, however it works fine except when I'm trying to install modules. Using cpanm just throws the modules on the C: drive.  No Good.  @INC doesn't go there and the admin doesn't want anything on there anyway.  I need them with Perl on the D:.</p>
  
  <p>So, I tried using cpan and changing the directories:</p>
  
  <pre><code>cpan&gt; o conf mbuildpl_arg "--install_base D:/strawberry/perl"
      mbuildpl_arg       [--install_base D:strawberryperl]
  commit: wrote 'D:\strawberry\perl\lib/CPAN/Config.pm'
  
  cpan&gt; o conf makepl_arg "PREFIX=D:/strawberry/perl"
      makepl_arg         [PREFIX=D:/strawberry/perl]
  commit: wrote 'D:\strawberry\perl\lib/CPAN/Config.pm'
  
  cpan&gt; install Email::Simple
  </code></pre>
  
  <p>It installed Email Simple in D:/strawberry/perl/lib - not perfect, but it works. Great!  A few others go through the same.  Go to install Module::Runtime</p>
  
  <pre><code>cpan&gt; install Module::Runtime
  </code></pre>
  
  <p>and that goes in D:/strawberry/perl/lib/perl5.  Huh?  OK, not perfect, but my @INC includes D:/strawberry/perl/lib so this shouldn't be a problem, right?  Go to install MooX::Types::MooseLike::Base</p>
  
  <pre><code>cpan&gt; install MooX::Types::MooseLike::Base
  </code></pre>
  
  <p>Won't install.  Here's the cpan barf out:</p>
  
  <pre><code>cpan&gt; install MooX::Types::MooseLike::Base
  Running install for module 'MooX::Types::MooseLike::Base'
  Running make for M/MA/MATEU/MooX-Types-MooseLike-0.29.tar.gz
  Checksum for D:\strawberry\cpan\sources\authors\id\M\MA\MATEU\MooX-Types-MooseLike-0.29.tar.gz ok
  
    CPAN.pm: Building M/MA/MATEU/MooX-Types-MooseLike-0.29.tar.gz
  
  Checking if your kit is complete...
  Looks good
  Warning: prerequisite Module::Runtime 0.014 not found.
  ... Detected uninstalled Perl.  Trying to continue.
  Have \strawb~1\perl\lib
  Want \strawberry\perl\lib
  Writing Makefile for MooX::Types::MooseLike
  Writing MYMETA.yml and MYMETA.json
  ---- Unsatisfied dependencies detected during ----
  ----  MATEU/MooX-Types-MooseLike-0.29.tar.gz  ----
      Module::Runtime [requires]
  Running make test
    Delayed until after prerequisites
  Running make install
    Delayed until after prerequisites
  Running install for module 'Module::Runtime'
  Running Build for Z/ZE/ZEFRAM/Module-Runtime-0.014.tar.gz
    Has already been unwrapped into directory D:\strawberry\cpan\build\Module-Runtime-0.014-yHdcFp
    Has already been made
  Running Build test
    Has already been tested successfully
  Running Build install
    Already done
  Running make for M/MA/MATEU/MooX-Types-MooseLike-0.29.tar.gz
    Has already been unwrapped into directory D:\strawberry\cpan\build\MooX-Types-MooseLike-0.29-UaWuDZ
  
    CPAN.pm: Building M/MA/MATEU/MooX-Types-MooseLike-0.29.tar.gz
  
  Warning: Prerequisite 'Module::Runtime =&gt; 0.014' for 'MATEU/MooX-Types-MooseLike-0.29.tar.gz' already built but the resu
  lt looks suspicious. Skipping another build attempt, to prevent looping endlessly.
  cp lib/MooX/Types/MooseLike.pm blib\lib\MooX\Types\MooseLike.pm
  cp lib/MooX/Types/MooseLike/Base.pm blib\lib\MooX\Types\MooseLike\Base.pm
    MATEU/MooX-Types-MooseLike-0.29.tar.gz
    D:\strawberry\c\bin\dmake.exe -- OK
  Running make test
  D:\strawberry\perl\bin\perl.exe "-ID:/strawberry/perl/lib" "-ID:/strawberry/perl/lib" "-MExtUtils::Command::MM" "-e" "te
  st_harness(0, 'blib\lib', 'blib\arch')" t/*.t
  t/basic.t ........................ Can't locate Module/Runtime.pm in @INC (@INC contains: D:\strawberry\cpan\build\MooX-
  Types-MooseLike-0.29-UaWuDZ\blib\lib D:\strawberry\cpan\build\MooX-Types-MooseLike-0.29-UaWuDZ\blib\arch D:/strawberry/p
  erl/lib D:/strawberry/perl/site/lib/MSWin32-x86-multi-thread D:/strawberry/perl/site/lib D:/strawberry/perl/vendor/lib D
  :/strawberry/perl/lib .) at D:/strawberry/perl/lib/Moo/_Utils.pm line 23.
  BEGIN failed--compilation aborted at D:/strawberry/perl/lib/Moo/_Utils.pm line 23.
  Compilation failed in require at D:/strawberry/perl/lib/Moo.pm line 13.
  BEGIN failed--compilation aborted at D:/strawberry/perl/lib/Moo.pm line 13.
  Compilation failed in require at t/basic.t line 4.
  BEGIN failed--compilation aborted at t/basic.t line 4.
  t/basic.t ........................ Dubious, test returned 2 (wstat 512, 0x200)
  No subtests run
  t/builder.t ...................... Can't locate Module/Runtime.pm in @INC (@INC contains: D:\strawberry\cpan\build\MooX-
  Types-MooseLike-0.29-UaWuDZ\blib\lib D:\strawberry\cpan\build\MooX-Types-MooseLike-0.29-UaWuDZ\blib\arch D:/strawberry/perl/lib D:/strawberry/perl/site/lib/MSWin32-x86-multi-thread D:/strawberry/perl/site/lib D:/strawberry/perl/vendor/lib 
  </code></pre>
  
  <p>And this error repeats a few times, and all the test fail, etc. etc.</p>
  
  <pre><code>Files=14, Tests=0,  1 wallclock secs ( 0.06 usr +  0.03 sys =  0.09 CPU)
  Result: FAIL
  Failed 14/14 test programs. 0/0 subtests failed.
  dmake.exe:  Error code 130, while making 'test_dynamic'
    MATEU/MooX-Types-MooseLike-0.29.tar.gz
  one dependency not OK (Module::Runtime); additionally test harness failed
    D:\strawberry\c\bin\dmake.exe test -- NOT OK
  //hint// to see the cpan-testers results for installing this module, try:
    reports MATEU/MooX-Types-MooseLike-0.29.tar.gz
  Running make install
    make test had returned bad status, won't install without force
  Stopping: 'install' failed for 'M/MA/MATEU/MooX-Types-MooseLike-0.29.tar.gz'.
  Failed during this command:
   MATEU/MooX-Types-MooseLike-0.29.tar.gz       : make_test NO one dependency not OK (Module::Runtime); additionally test
  harness failed
  </code></pre>
  
  <p>So, Questions....</p>
  
  <p>(1) What do I need to do to put Module::Runtime in the correct place?   My previous attempt to change directories worked for some, but not this one.  I would prefer D:\strawberry\perl\site\lib - as it seems that cpanm would put it's modules there, but D:\strawberry\perl\lib would work fine too.</p>
  
  <p>If we fix number (1) this doesn't matter, but I am curious if anyone has an answer:</p>
  
  <p>(2) Why can't cpan find Module::Runtime, when it is in one of the subdirectories of @INC?</p>
  
  <p>So I know that one answer is to reinstall strawberry in the correct spot, but this is a production box with constant running Perl scripts and no down time, so no, that isn't an option.  They won't allow me to do that anyway.</p>
  
  <p>Thanks in advance for the help.</p>