Manual installation of Perl modules in Windows

12,565

Solution 1

I take it you're using ActivePerl. It's nice, but if you need something that's not in PPM, you're sort of stuck. Take a look at the PPM configuration. By default, it only includes the ActiveState PPM site, but you can configure it to use other repositories too. Check under the Edit->Preference menu. Then click on the "Repositories" tab. There are six other PPM repositories you can include in your list of PPM repositories. Add them in, and see if your CPAN modules are in those.

The other Perl choice for Windows is Strawberry Perl. This includes a MinGW distribution that comes with a minimally configured gcc compiler and base libraries. That allows you to use almost any module in the CPAN archive without modification.

Solution 2

Run a command box (cmd.exe) and type 'cpan Win32::Printer' and it should install automatically.

Share:
12,565
Chad Baker
Author by

Chad Baker

Updated on June 04, 2022

Comments

  • Chad Baker
    Chad Baker almost 2 years

    I have tried (unsuccessfully) many times to manually install a Perl module (Win32-Printer-0.9.1) found in CPAN, but not included in the PPM repository. What I know is that the module must be downloaded and decompressed. I know you have to run the MakeFile.pl that is included.

    And I know nmake is involved somehow, but despite trying to follow the directions found online, I've been unable to get it to work.

    I'm using ActivePerl 5.12.2 on Windows.

    I really can't figure out why this would be so complicated!

  • MichielB
    MichielB over 12 years
    ActivePerl has a proper CPAN compiler since a couple of years, very similar to Strawberry Perl: perl.com/pub/2011/08/using-cpan-on-win32-activeperl.html
  • David W.
    David W. over 12 years
    @MichielB: That's nice to know. I like ActivePerl, but the lack of a compiler has been a problem. I usually had to install MinGW and do some hacking to get it to work, but decided Strawberry Perl is easier. Still, as the page you pointed out stated: Windows does not support all POSIX features which might mean a few CPAN packages might not work too well. Still, the original poster is running 12.2 which should have a C compiler and is trying to download Win32:Printer. You'd think that would work.
  • MichielB
    MichielB over 12 years
    Well, if you download the package - typically a .tar.gz - off CPAN you might have a hard time installing it. You normally don't have an archiver that can handle .tar.gz on Windows, and you'll need to manually install any deps. You'll only get the C-compiler when you install the 'cpan' package via PPM first. Only then you can install the module conveniently, i.e. via the CPAN client.
  • David W.
    David W. over 12 years
    Oh, I get it now! I have to go to PPM, install the CPAN module, and then I get the compiler and be able to install stuff via CPAN. Apparently, you only have to point something out to me twice before it penetrates my skull. Thanks again. I'm going to install ActiveState Perl just to give it a try.