Perl: V 5.8.8 : Can't locate auto/XML/LibXSLT/

2020-04-27 00:38发布

问题:

I am getting Can't locate auto/XML/LibXSLT/new.al error on my CentOS5 machine installed Perl 5.8.8

This issue is related with libxml2 and perl modules XML::LibXML, XML::LibXSLT. For both version in 1.70.

Upon settling both modules, further I am getting error for

Can't locate auto/XML/LibXSLT/new.al

which seems to be a autoload function of LibXSLT, But surprisingly I am not finding any file as new.al.

Here is the code snippet through which I am getting this error

use XML::LibXML;
use XML::LibXSLT;
my $parser = XML::LibXML->new;
my $xslt = XML::LibXSLT->new;

Any Help would be appreciated.

回答1:

I think your XML::LibXSLT installation is not healthy. Try below. It worked for me:

# yum -y install perl-XML-LibXSLT
# perl -e 'use XML::LibXSLT'

And it worked for me on ubuntu as well. Here is the command:

# aptitude install libxml-libxslt-perl