NITIN MATHUR
NITIN MATHUR

Reputation: 1

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

I am trying to run script which uses XML/LibXML package. But, XML/LibXML package is already installed. I ran following command: perl -MXML::LibXML -e 1. it did not give any output, that means this package is installed.

when i ran my script. Following error occured.

Can't locate XML/LibXML.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .). BEGIN failed--compilation aborted.

One more point to note is there is no directory "5.8.8" under /usr/lib64/perl5/site_perl/

Please suggest to overcome this issue.

Upvotes: 0

Views: 3931

Answers (1)

ikegami
ikegami

Reputation: 386561

There are three possibilities:

  • You have two installs of perl and you script is using the "wrong" one.

    Either install XML::LibXML using the perl used by the script, or replace the script's shebang (#!) line with the output of the following:

    perl -MXML::LibXML -le'print "#!".$^X'
    
  • Differences in the environment.

    If XML::LibXML was installed in a nonstandard directory, it could be that PERL5LIB was used to communicate this to perl when you executed your test, but not when you run the script.

  • A permission issue.

    This isn't very likely.

    If the script is run as the same user as your test, it's not a permission issue.

    If it is a permission issue, make sure the library directory is accessible to the user executing the script.

Upvotes: 1

Related Questions