A few days ago, I posted a question 'Installing modules on Win32'. This meditation is really a thank-you note (to a lot of the people who replied: jcwren, tye, toadi and many others) including and advice (and some caveats) for other people in my position.

I wasn't having real luck with the Activestate's Perl distro, and toadi mentioned Dynamicstate. I wasn't very impressed with their Perl2Exe product, but I went ahead and downloaded IndigoPerl (Dynamicstate is now Indigostar.) It installed fine, but when I tried installing modules, I had much the same problem: 'Can't find Perl in c:\perl\bin\perl.exe' etc.

Some of my difficulties with IndigoPerl were caused by having ActiveState Perl still in my PATH environment variable. So, I modified my AUTOEXEC.BAT file to only include IndigoPerl and then I restarted.

I continued trying to install my test module, lhoward's Number::Spell module. Typing 'perl makefile.pl' threw up the usual errors, e.g. 'Cannot find Perl in...', and then I had trouble 'make-ing' it. I finally tracked this down to using the WRONG make program! You must use whatever make program perl -V:make tells you. (Thanks to tye for the reply that put me on the right track here.)

In the case of IndigoPerl, this is nmake, freely available from M$ here.

Because MakeMaker.pm couldn't find my copy of Perl (I still don't understand this. I haven't changed any of the installation settings, and installed it as recommended), I decided to do the unforgivable (::grin::): hack the makefile manually! I changed the lines:

PERL = 0
FULLPERL = 0

to:

PERL = perl
FULLPERL = perl

Typing nmake then did the trick - I was then able to copy the newly created Number and Spell directories to my IndigoPerl lib dir. Doing

perl -e "use Number::Spell; print spell_number(123);"
finally had the desired result!

IndigoStar's DPM package management program (equivalent of Activestate's PPM) is far easier to use than DPM, and actually works! The good news is that DPM uses the same package format as Activestate, so you can just use their (Activestate's) repositories. DPM can also apparently install modules that are .tar.gz-ed, but I have unable to find a command-line tar prog, so I haven't tested that yet :-)

I still have no idea about modules that require C (or XS) files to be compiled. Under Linux, it's all so easy as GCC seems to do the trick (worked for me with Crypt::Blowfish on Linux) but apparently you need MSVC++ on Win32. GCC is available for Win32, so it is frustrating that that can't be used.

Thanks to all those who helped, and I hope this helps people installing modules on Win32 machines.

Replies are listed 'Best First'.
RE: Thanks -- Win32 module help
by tye (Sage) on Jul 21, 2000 at 22:00 UTC

    The reason that MakeMaker can't find Perl is because:

    1. $^X is returning "c:\\perl\\bin\\perl.exe" instead of the usual "perl".
    2. The line of perl/lib/ExtUtils/MM_Win32.pm that reads next unless $self->maybe_command($abs); should really read next unless $abs= $self->maybe_command($abs);.

    Please do me a favor and use perlbug to report number 2 so it will be fixed (this saves me some time and gives you a little practice in contributing to the community).

    As for number 1, it might be something weird about IndigoPerl or about the way you are executing perl Makefile.PL. Perhaps you have a file type association for *.PL and are just running Makefile.PL which translates into c:\perl\bin\perl.exe Makefile.PL, which triggers the bug in MM_Win32.pm.

    The DynamicState web site says that you'll need DevStudio (aka Microsoft Visual Studio, including Visual C++) to build modules that include XS code.