Search code examples
perlcpan

Having trouble installing a CPAN module on Strawberry Perl running on Windows 7


I've got Strawberry Perl installed on a Windows 7 system. Also have a MinGW installation located in C:\MinGW\msys\bin (where my make.exe resides). Strawberry is located in c:\Strawberry\Perl\bin.

I'm trying to install HTML::TableContentParser into a local library, and the script that installs the module fails with a "cannot find the path specified" error, and tells me to build manually, which I don't know how to do, and have been unable to find instructions that work. It always comes back to the makefile somehow.

Here's what I get when I run "cpan HTML::TableContentParser" from my c:\strawberry\perl\bin directory:

C:\Users\joel>cd c:\strawberry\perl\bin

c:\Strawberry\perl\bin>cpan HTML::TableContentParser
Loading internal null logger. Install Log::Log4perl for logging messages
CPAN: Storable loaded ok (v2.56_01)
Reading '\c\Users\joel\.cpan\Metadata'
  Database was generated on Mon, 15 May 2017 15:54:01 GMT
Running install for module 'HTML::TableContentParser'
CPAN: Digest::SHA loaded ok (v5.96)
CPAN: Compress::Zlib loaded ok (v2.07)
Checksum for \c\Users\joel\.cpan\sources\authors\id\S\SD\SDRABBLE\HTML-       TableContentParser-0.13.tar.gz ok
The system cannot find the path specified.
Uncompressed \c\Users\joel\.cpan\sources\authors\id\S\SD\SDRABBLE\HTML-TableContentParser-0.13.tar.gz successfully
Using Tar:/usr/bin/tar xf "HTML-TableContentParser-0.13.tar":
The system cannot find the path specified.
Couldn't untar HTML-TableContentParser-0.13.tar: child exited with value 1
CPAN: YAML loaded ok (v1.21)
  SDRABBLE/HTML-TableContentParser-0.13.tar.gz
  Had problems unarchiving. Please build manually

Solution

  • Try the following:

    1. Do not use separate MinGW it already comes packed with Strawberry Perl. Make sure you have a recent version of Strawberry Perl.

    2. Download the tar.gz for the perl module from any of the sites(Metacpan or Cpan).

    3. Use winzip to unzip it which will give you all files extracted to a location.

    4. Now open command prompt and change directory to the one where you extracted the tar.gz for the perl module.

    5. Run the following commands then:

      • perl Makefile.pl
      • dmake
      • dmake test
      • dmake install

    The command dmake test one is optional, if you get errors here try skipping to the next command and try using the module in your scripts. As many times the test fails does not means the module won't install or work properly. If there is error the module will give error in installation too.

    Make sure you have the Makefile.pl file in the extracted directory. This will install the module without any issues.

    I am assuming that you are working on a Windows system. Do let me know if you face any errors still.