http://www.perlmonks.org?node_id=1020735

topbanana has asked for the wisdom of the Perl Monks concerning the following question:

Hello, So, I'm trying to use XML::LibXSLT and I get
~/perl J-PC:J >./hello.pl Can't locate XML/LibXSLT.pm in @INC (@INC contains:...<snip>
I'm running cygwin; I've downloaded and installed LibXSLT using cygwin's installer.
I tried the cygwin install method (of libxslt) again but, as might be expected, it said, nothing to install. Seeing people talk about cpan, I tried
~/perl J-PC:J >cpan App::cpanminus Sorry, we have to rerun the configuration dialog for CPAN.pm due to some missing parameters. Configuration will be written to <</home/J/.cpan/CPAN/MyConfig.pm>> CPAN.pm requires configuration, but most of it can be done automatical +ly. If you answer 'no' below, you will enter an interactive dialog for eac +h configuration option instead. Would you like to configure as much as possible automatically? [yes] y +es
at which I got pages and pages of
Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip Press SPACE and ENTER to disable unzip
How can I install LibXSLT? I thought with cygwin, all you had to do was run the cygwin setup utility every time you needed a module, and it would work out dependencies and fetch and install the needed modules for you...otherwise, what is it fetching and installing? It's definitely downloading and installing, but what and where? Thanks, J
Update:
I'm wondering if I am misunderstanding what cygwin is downloading. After all, cygwin doesn't know that I want perl modules. Is there a difference between cygwin's libxslt and the libxslt perl module?
Even so, I still have the issue that I'm not able to use cpan in cygwin, for some reason.
Update2:I see I can download XML-LibXSLT-1.57.tar.gz *manually* from http://search.cpan.org/~msergeant/XML-LibXSLT-1.57/LibXSLT.pm. Is this the way to go? If so, what do I do with it? It unzips to a tarball, which "untars" to a load of files...am I supposed to compile this stuff? Thanks, J

Replies are listed 'Best First'.
Re: (Cygwin) Can't locate XML/LibXSLT.pm in @INC
by rurban (Scribe) on Feb 26, 2013 at 19:45 UTC
    Maintainer speaking:

    You need to install a devel library first if you want to compile a module using it. So you need to install libxslt-devel via setup.exe. And the you also need to install perl_vendor for cpan. Then run:

    $ cpan XML::LibXSLT

    Apparently you are also missing a lot of more cygwin packages, such as unzip. Check your error messages and install the missing packages.

      "Maintainer speaking"

      Despite some truth in your post: what do you maintain...;-)

      Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

Re: (Cygwin) Can't locate XML/LibXSLT.pm in @INC
by 7stud (Deacon) on Feb 26, 2013 at 18:50 UTC

    Update2:I see I can download XML-LibXSLT-1.57.tar.gz *manually* from http://search.cpan.org/~msergeant/XML-LibXSLT-1.57/LibXSLT.pm. Is this the way to go? If so, what do I do with it? It unzips to a tarball, which "untars" to a load of files...am I supposed to compile this stuff? Thanks, J

    To 'install from source' the typical steps are unpack, cd into the newly created directory, then:

    
    $ perl Makefile.PL (or Build.PL)
    $ make
    $ make test
    $ make install
    

    However, I would continue trying to get cpan to work instead. Once you get cpan working, you can just type: cpan Some::Module.

      Thanks all for your help.
      I gave up (twice) but finally got it all sorted. I had to go through the CPAN set-up line by line and each time it failed go off to cygwin and download the missing component. The error message ("press space and enter" a million times) was caused I think by CPAN trying to use an unzip.exe in my Oracle bin directory. Also had to install XML::LibXML and XML::LibXML::Common, and another C compiler, amongst many other things. At least, now I can run my program (albeit all it has in it is "use XML::LibXSLT" so far...but it's encouraging). Thanks again.
Re: (Cygwin) Can't locate XML/LibXSLT.pm in @INC
by tobyink (Canon) on Feb 26, 2013 at 18:53 UTC

    XML::LibXSLT is a Perl wrapper around the C libxslt library. Cygwin will have installed the latter. Yes, XML::LibXSLT needs to be compiled as parts of it are written in C.

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name