Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

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.

Install Visual Studio1

First up, CPAN gripes endlessley if you try to 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 (an alternative is to map a path to a virtual drive using the Windows-native command subst - thanks to Roy Johnson for this tip). You can pick Junction up from http://www.sysinternals.com/Utilities/Junction.html. Run it as:

junction c:/vs2003 "C:\Program Files\Microsoft Visual Studio 7"

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.

Install cygwin

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.

During the install you should add the following non-default packages:

  • Archive/unzip
  • web/lynx
  • web/wget
  • net/ncftp
  • utils/gnupg

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.

Installing CPAN

Open a command window using "Programs|Microsoft Visual Studio 200x|Visual Studio Tools|Visual Studio 200x Command Prompt"2

Append the cygwin bin folder to the search path:

set path=%path%;c:\cygwin\bin

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.

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.

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.

Other than that, just accept the defaults and you are done.

TIMTOWTDI

During the first airing of this as a meditation a couple of 'see also's were suggested:

1Oh, 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.

2If 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 this node


DWIM is Perl's answer to Gödel

In reply to Installing CPAN on a Windows system by GrandFather

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (8)
    As of 2014-09-17 07:47 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (65 votes), past polls