perlmeditation
GrandFather
<p>Assuming you have installed ActiveState Perl the following is a guide to
getting CPAN's cpan module install tool working on a Windows XP system with
Visual Studio.</p>
<h3>Install Visual Studio<sup>1</sup></h3>
<p>First up, CPAN absolutely will not run nmake from a path including a space. If
you have Visual Studio installed to its default location in .../Program
Files/... and you are using NTFS then your best bet is to use System Internals'
Junction to create a hard link to the Visual Studio install folder. You can pick
Junction up from
[http://www.sysinternals.com/Utilities/Junction.html]. Run it as:</p>
<c>
junction c:/vs2003 "C:\Program Files\Microsoft Visual Studio 7"
</c>
<p>If you are yet to install Visual Studio then you should seriously consider
installing it to a non-default path that doesn't include spaces in the path.</p>
<h3>Install cygwin</h3>
<p>Install cygwin from http://cygwin.com/setup.exe. When the setup promts you to
choose a download site you should choose four or so mirrors to help avoid stale
mirror syndrome.</p>
<p>During the install you should add the following non-default packages:</p>
<ul>
<li>Archive/unzip</li>
<li>web/lynx</li>
<li>web/wget</li>
<li>net/ncftp</li>
<li>utils/gnupg</li>
</ul>
<p>Note that you can use the View button to toggle between different package
views. "Not Installed" and "Category" are most usefull for this job. Click on
"Skip" to select a package for installation.</p>
<h3>Installing CPAN</h3>
<p>Open a command window using "Programs|Microsoft Visual Studio 200x|Visual
Studio Tools|Visual Studio 200x Command Prompt"<sup>2</sup></p>
<p>Append the cygwin bin folder to the search path:</p>
<c>
set path=%path%;c:\cygwin\bin
</c>
<p>Run CPAN - just type cpan on the command line and hit enter. The AS Perl
install proivides a batch file on the path that runs the cpan tool.</p>
<p>The first time cpan is run it wants to go through a configuration process.
Mostly using the default options is fine. I'd recommend using "follow" at the
"Policy on building prerequisites" prompt however.</p>
<p>The most important thing to check is that the path for nmake is correct and
doesn't include spaces. If you have a default VS install then most likely you
will need to change the path to use the hard link you created with Junction.</p>
<p>Other than that, just accept the defaults and you are done.</p>
<p><sup>1</sup>Oh, there is a gotcha - things go rather pear shaped if you use VS 2005 to
build against AS Perl 5.8.7 (815) and earlier builds (and possibly against 5.8.8
when it's available) because the binaries generated by VS 2005 do not play with
the VC++ 6 binaries built with an earlier compiler.</p>
<p><sup>2</sup>If you use the command line reguarly it is well worth migrating
the contents of the batch file invoked by this command into your environment.
[demerphq] has written a script to ease the process - see the update to
[id://289272|this node]</p>
<div class="pmsig"><div class="pmsig-461912">
<hr>DWIM is Perl's answer to Gödel
</div></div>