Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

xml

perl

cpan

rouge

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.
like image 698
Tushar Hanwate Avatar asked Jun 02 '16 11:06

Tushar Hanwate


2 Answers

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

like image 191
Borodin Avatar answered Oct 31 '22 23:10

Borodin


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

like image 1
Mihai.Mehe Avatar answered Oct 31 '22 23:10

Mihai.Mehe