title: syncing perlbrew and cpan install locations
body: <p>I'm using perlbrew to run a local perl in my home directory, and cpan to install new modules.  However, I seem to have something configured wrong.  When I use cpan it always installs libraries to the ~/perl directory, but my perlbrew is located in ~/perl5 directory.  This is causing some issue with creating appropriate PERL5LIB directory, rather I should include perl or perl5 libs and in what order.  I seem to keep running into chicken and the egg problem where including either first results in loading a wrong module or complaints about the wrong version used.  Specifically it complains that the 5.8.8 perl version (first I installed before deciding to upgrade to a slightly-less-ancient version, and still the version of /bin/perl) conflicts with the 10.1 libraries I'm using.</p>
  
  <p>I figure this can likely be fixed by updating configuration files, but I'm not sure what to change.  I look at my cpan config.pm and I don't see anything defining installation direction, in fact I'm not sure how cpan knows to install locally rather then trying to install to the global cpan directory.</p>
  
  <p>Can anyone point me to the appropriate configuration values I need to change to get cpan to update my perlbrew library, rather then getting two separate libraries?</p>
  
  <p>Edit</p>
  
  <p>Okay I'm very blind.  The answer was right in my configuration file at ~/.cpan/CPAN/MyConfig.pm.  I swear I looked at the file a few times, even doing a search for the word perl to hunt down any line that may point to my ~/perl directory, and yet somehow missed the blindingly obvious configuration option I was looking for...not sure how.</p>
  
  <p>Anyways, once I saw it I just had to change where it pointed, which took a little trial in error.  I changed this line:</p>
  
  <pre><code>'makepl_arg' =&gt; q[PREFIX=~/perl],
  </code></pre>
  
  <p>to </p>
  
  <pre><code>'makepl_arg' =&gt; q[PREFIX=~/perl5/perlbrew/perls/perl-5.10.1/],
  </code></pre>
  
  <p>which of course is the location of the perl version I'm using for perlbrew.  This appears to fix my problem, and should have been easy if I wasn't blind.</p>
  
  <p>I do have one annoyance, I have both this line and my PERL5LIB variables, set in ~/.bashrc, effectively hard coded to point to the perl-5.10.1 version of perllib, meaning if I decide to switch to another perl version I would need to update both references or have issues again.  I'm not sure how to make cpan, or my PERL5Lib for that matter, know to infer which version of perl from the perls directory it should use.  That's not too big of a problem to me, I don't think I'll be allowed to upgrade past 5.10.1 (even though I want to) so it's unlikely I'll ever change this value.  Otherwise it works fine now.</p>