Perl Compilation Error: “Can't locate local/lib.pm”

房东的猫 提交于 2019-12-21 22:13:14

问题


As a Perl rookie, I have made a rookie mistake.

I was working on a project that required an HTML parser so I thought I'd install Perl's HTML::TreeBuilder::XPath module, so I dove into cpan and perlbrew without a full understanding of how they work. I created a local library, but would like to return everything back to default. However, I get this error every time I open a terminal window (twice, for some reason):

Can't locate local/lib.pm in @INC (@INC contains: 
/Users/James/perl5/lib/perl5
/Library/Perl/5.12/darwin-thread-multi-2level
/Library/Perl/5.12
/Network/Library/Perl/5.12/darwin-thread-multi-2level 
/Network/Library/Perl/5.12 
/Library/Perl/Updates/5.12.4/darwin-thread-multi-2level 
/Library/Perl/Updates/5.12.4
/System/Library/Perl/5.12/darwin-thread-multi-2level
/System/Library/Perl/5.12
/System/Library/Perl/Extras/5.12/darwin-thread-multi-2level
/System/Library/Perl/Extras/5.12 .).
BEGIN failed--compilation aborted.

I've seen the similar StackOverflow question here but I do not have apt-get installed.

How can I reset my machine so that this error no longer appears and it uses the default library?


回答1:


The local::lib installation instructions tell you to add a line to your .bashrc or .bash_profile. From your error, it looks like the line

eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"

is still present. Look for it and remove it.



来源:https://stackoverflow.com/questions/33086310/perl-compilation-error-cant-locate-local-lib-pm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!