PGTS PGTS Pty. Ltd.   ACN: 007 008 568

point Site Navigation

point Other Blog Threads

  Valid HTML 4.01 Transitional

   Stop Spam! Stop Viruses!
   Secure And Reliable Ubuntu Desktop!


   If you own a netbook/laptop~
   Download Ubuntu Netbook!

PGTS Humble Blog

Thread: Perl Programming

Mission Accomplished -- George Bush, 2003.

Strange cygwin cpan errors

Chronogical Blog Entries:

Date: Fri, 14 May 2010 18:25:31 +1000

A recent weird encounter with cygwin perl had me puzzled. It occurred when I attempted to install XML::Simple in cygwin. Everything went ok, until the final test stage. And then the installation mysteriously failed

The following errors were reported at the cpan prompt:
Prepending /cygdrive/h/.cpan/build/XML-Simple-2.18-zcfTOo/blib/arch /cygdrive/h/.cpan/build/XML-Simple-2.18-zcfTOo/blib/lib to PERL5LIB for 'install'
Not a HASH reference at C:/Perl/lib/ExtUtils/ line 557.
make: *** [pure_site_install] Error 2
  make install  -- NOT OK
Failed during this command:
 GRANTM/XML-Simple-2.18.tar.gz                : install NO

Curiously enough all of the configuration files were cygwin. Where had cpan obtained the reference to the ActivePerl module? I thought perhaps the system path?

Whatever ... Once it got into the cpan module it was rather difficult to remove.

I then tried to kludge it ... And succeeded, possibly more by good luck than good management.

First I edited the Makefile in the build folder. This had been stored in /cygdrive/h/.cpan/build/XML-Simple-2.18-zcfTOo/Makefile

I replaced all instances of /cygdrive/c/Perl/perl.exe with /usr/bin/perl and saved a copy of the edited Makefile.

I then used this command in cpan
clean GRANTM/XML-Simple-2.18.tar.gz
make GRANTM/XML-Simple-2.18.tar.gz

I then copied the modified Makefile (which I had saved) over the top of the existing Makefile, and then entered the following:
install GRANTM/XML-Simple-2.18.tar.gz

More weirdness ensured when I tried to use cygwin perl XML parser. This message appeared.

	"could not find ParserDetails.ini"

I tried installing the XML::SAX package again (as suggested online) and saw a similar error message in the test phase of the install. I solved this by "cleaning, "getting" and "making" the XML::SAX module. And then touching ParserDetails.ini in the build folder (cpan told me the folder name in the previous error message from the cpan test). After I ran the install from cpan I copied ParserDetails.ini into the perl library

And everything worked ... (huh?)

Note: To avoid similar problems it might be a good idea to edit the path in your .bash_profile and REMOVE the reference to C:/Perl. In the latest version of cygwin this can be accomplished with the following:
export PATH=`echo $PATH | sed -e 's/:\/cygdrive\/c\/Perl\/bin\///'`

Update: 2015-12-11 After struggling with many Windows/Perl versions, I have decided the easiest way to install CPAN modules on any system that has a Windows back-end (i.e. native or cygwin) is to get the CPAN package and install it in the "site" Library.

Other Blog Posts In This Thread:

Copyright     2010, Gerry Patterson. All Rights Reserved.