How do I install XML::LibXML for ActivePerl?
Asked Answered
T

5

6

I am new to Perl and I am using ActivePerl. I am getting the following error:

Can't locate XML/LibXML.pm in @INC...

I have tried everything but cannot find the steps to install the "correct" module for XML::LibXML.

Here is exactly what is going on. I am running a script from a command prompt:

c:\temp>perl myscript.pl

The first few lines of myscript.pl:

#!/usr/bin/perl

use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
use HTTP::Date;
use XML::Parser;
use LWP::UserAgent;
use XML::LibXML;
use Archive::Extract;
use Encode;
use LWP::Simple;

require HTTP::Request;
...

Then I get this error:

c:\temp>perl myscript.pl Can't locate XML/LibXML.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at myscript.pl line 7. BEGIN failed--compilation aborted at myscript.pl line 7

Turkey answered 7/9, 2009 at 22:18 Comment(2)
Are you trying to use XML::LibXML directly, or is this a dependency of another module you're using?Felicitous
I added some more details above. I have added the packabe libxml using the activeperl package managerTurkey
P
7

You should be able to install it with the ActivePerl Perl Package Manager. There should have been a start menu shortcut created when you installed ActivePerl, start the GUI and search for xml-libxml and libxml-perl.

--edit

Here's a post on adding an alternative repository to PPM and installing XML-LibXML

Patrilineage answered 7/9, 2009 at 22:43 Comment(6)
Thanks, But I installed "libxml-perl" from the "ActivePerl Package Manager" and I still get the same error. I checked the details and that package does not install LibXML.pm Here is a screen shot bit.ly/cf3avTurkey
Try searching for xml-libxml.Patrilineage
Nope nothing is coming up... I added some more details to the question. thanks!Turkey
This package is currently available with the package manager: I just installed it.Catherin
xml-libxml does not install a LibXML.pm for me. Using ActivePerl 5.16 and PPM 4.17. Unfortunately the theoryx5 repo in the forum link returns 503 errors.Ogata
Apparently there's no LibXML.pm on 5.16. See my answer below for fix.Ogata
P
3

It doesn't look like ActiveState provide a PPM with XML::LibXML. I looked in the README for the module on CPAN and apparently a prebuild ppm package is available here.

Pulmonic answered 8/9, 2009 at 19:18 Comment(1)
above link is 503 error for me, but sources available from cpan here search.cpan.org/perldoc?XML%3A%3ALibXMLOgata
K
2

I have recently been through the pains of getting XML::LibXML installed. Here is what I found:

  1. We are using ActiveState ActivePerl 5.8.8
  2. In order for ActivePerl's PPM to get through our proxy, had to create an environment variable "http_proxy" with value "http://proxy.ext.[example].com", then re-login.
  3. The required packages weren't all located in ActiveState's repository. Added University of Winnipeg's Perl Repository http://theoryx5.uwinnipeg.ca/ppms/package.xml (note that the exact repository used depends on your version of ActivePerl)
  4. Manually install the following DLLs into C:\perl\bin\ (for whatever reason, I was having some trouble building these DLLs, so I ended up simply grabbing them from the repository at http://trouchelle.com/ppm/dll/ )
    • iconv.dll
    • libxml2.dll
    • zlib1.dll
  5. At least for the version of XML-LibXML we are using, the package installer doesn't work correctly for the prerequisite XML-LibXML-Common. You MUST install the package XML-LibXML-Common by itself, BEFORE installing the rest of XML-LibXML.

Although they may not be the latest versions, the versions of the packages (including prerequisites) which I am currently using are:

  • XML-LibXML-Common (ver 0.13)
  • XML-LibXML (ver 1.64)
  • XML-NamespaceSupport (ver 1.10)
  • XML-SAX (ver 0.96)
Kaffraria answered 17/1, 2012 at 19:41 Comment(2)
I have the same issue today. Did you just copy those 3 .dll in the folder C:\Perl\bin\ ? Using search from ppm, it only returns libxml-perl [0.08] libxml-perlTelecast
Yes, I just copied those 3 DLLs which I described.Kaffraria
O
1

Accepted answer didn't work for me on 5.16. From this question:

XML::LibXML was not ready for Perl 5.16. Install 5.14

Download:

Ogata answered 17/1, 2013 at 12:58 Comment(0)
J
0

In the end I found the only alternative ActivePerl repository in existence, as far as I can tell, and it had a package for XML::LibXML 2.0121 which will install on perl versions up to 5.20.x.

You can obtain releases of ActivePerl from here that includes 5.20.2: downloads.activestate.com/ActivePerl/releases/

The alternative repository is called Bribes de Perl at bribes.org/perl/

The URL of the repository that is entered in options is http://bribes.org/perl/ppm/

Jos answered 30/8, 2015 at 21:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.