Can't locate CPAN.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5

I tried to install some modules to a new server (fedora core 18) but I'm getting this error:

Can't locate CPAN.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .). BEGIN failed--compilation aborted. 

The module I need to install is : XML/Writer.pm

because I'm getting this error:

Can't locate XML/Writer.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 . 

Do any of you know why, or how can I fix these errors?

1 Answer

Some OS distributions cut out pieces of the core Perl distributions. In this case, it appears that the very tool to install modules was gutted out, so you need to get the OS to install it.

Try to install CPAN using

yum -y install perl-CPAN 

and then use cpan command to install the required modules

cpan XML::Writer 
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like