Can't locate XML/DOM.pm in @INC (you may need to install the XML::DOM module)
Asked Answered
S

3

8

I am new user for the Perl language where executing a Perl script comparison based on ROUGE tool.

I didn't get my result on a specific dataset. Please suggest what to do to avoid such type of error.

I am getting this error when I execute runROUGE-test.pl from the terminal.

It always shows the same error i.e Can't locate XML/DOM.pm in @INC

tushar@ubuntu:~/Desktop/RELEASE-1.5.5$ ./runROUGE-test.pl

./ROUGE-1.5.5.pl -e ../data -c 95 -2 -1 -U -r 1000 -n 4 -w 1.2 -a ROUGE-test.XML > ../sample-output/ROUGE-test-c95-2-1-U-r1000-n4-w1.2-a.out
**Can't locate XML/DOM.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2** /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at ../ROUGE-1.5.5.pl line 173.
Schwarzwald answered 2/6, 2016 at 11:55 Comment(2)
cpan install XML::DOMEncumbrance
I needed to run the install command as sudo.Romeo
B
7

I think the full text of your error message is this

Can't locate XML/DOM.pm in @INC (you may need to install the XML::DOM module) (@INC contains: ...

There's a very good clue there that you may need to install the module, which you can do using cpanm XML::DOM or cpan XML::DOM. If neither of those options work for you then you should ask another question

Bum answered 2/6, 2016 at 12:9 Comment(1)
perl -MCPAN -e 'install XML::DOM'Androw
B
1

I encountered an issue where the script ROUGE-1.5.5.pl mentioned this version of perl: #!/usr/bion/perl which happened to be an old one 5.18.2

So cpan install XML::DOM was installing the module for the version 5.28.1 and therefore I was still getting the same error with the module installed.

Solution: Add this to the script: $ nano ROUGE-1.5.5.pl

Add the current version of perl that has the module (in my case was #!/Applications/anaconda3/bin/perl)

To find out which version of perl you are using and you updated with XML::DOM, run: $ which perl

Bumblebee answered 17/12, 2018 at 2:48 Comment(0)
H
0

For those who are not working on PERL but stumble across this issue, this worked for me

sudo apt-get install libxml-parser-perl

My exact issue - Running the evaluation script for https://github.com/allenai/scitldr.

Hardfavored answered 15/12, 2021 at 11:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.