5

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?

Community
  • 1
  • 1
James
  • 117
  • 1
  • 1
  • 10
  • 1
    You have a `use local::lib` somewhere, and you don't need it any longer if you have everything installed normally – Borodin Oct 12 '15 at 16:56

2 Answers2

19

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.

darch
  • 4,200
  • 1
  • 20
  • 23
-1

For me this meant I had an earlier aborted run of cpan's installation.

fix: remove ~/.cpan and ~/perl5 dirs, and remove anything about them from .bashrc, and do it again...

rogerdpack
  • 62,887
  • 36
  • 269
  • 388