0

I'm having the following problem I don't know what introduced it but perl include path's on a Mac were always a nightmare;

cpan[1]> install DateTime::Event::Recurrence
Going to read '/Users/Hristo/.cpan/Metadata'
  Database was generated on Tue, 08 Jan 2013 11:07:23 GMT
Fetching with LWP:
http://ftp.belnet.be/mirror/ftp.cpan.org/authors/01mailrc.txt.gz
Catching error: "Can't locate HTML/HeadParser.pm in \@INC (\@INC contains: /opt/local/lib/perl5/site_perl/5.12.4/darwin-thread-multi-2level /opt/local/lib/perl5/site_perl/5.12.4 /opt/local/lib/perl5/vendor_perl/5.12.4/darwin-thread-multi-2level /opt/local/lib/perl5/vendor_perl/5.12.4 /opt/local/lib/perl5/5.12.4/darwin-thread-multi-2level /opt/local/lib/perl5/5.12.4 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl /Users/Hristo) at /opt/local/lib/perl5/site_perl/5.12.4/LWP/UserAgent.pm line 663, <FIN> line 1. at /opt/local/lib/perl5/site_perl/5.12.4/LWP/UserAgent.pm line 915, <FIN> line 1.\cJ" at /opt/local/lib/perl5/5.12.4/CPAN.pm line 391, <FIN> line 1.
    CPAN::shell() called at /opt/local/lib/perl5/5.12.4/App/Cpan.pm line 295
    App::Cpan::_process_options('App::Cpan') called at /opt/local/lib/perl5/5.12.4/App/Cpan.pm line 364
    App::Cpan::run('App::Cpan') called at /opt/local/bin/cpan line 11
Fetching with LWP:
http://ftp.belnet.be/mirror/ftp.cpan.org/authors/01mailrc.txt.gz
Terminal does not support GetHistory.
Lockfile removed.
Can't locate HTML/HeadParser.pm in @INC (@INC contains: /opt/local/lib/perl5/site_perl/5.12.4/darwin-thread-multi-2level /opt/local/lib/perl5/site_perl/5.12.4 /opt/local/lib/perl5/vendor_perl/5.12.4/darwin-thread-multi-2level /opt/local/lib/perl5/vendor_perl/5.12.4 /opt/local/lib/perl5/5.12.4/darwin-thread-multi-2level /opt/local/lib/perl5/5.12.4 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl /Users/Hristo) at /opt/local/lib/perl5/site_perl/5.12.4/LWP/UserAgent.pm line 663, <FIN> line 1. at /opt/local/lib/perl5/site_perl/5.12.4/LWP/UserAgent.pm line 915, <FIN> line 1.

I have HTML::HeadParser in /opt/local/lib/perl5/site_perl/5.12.4/darwin-multi-2level/HTML CPAN Has worked for months before this.

How do I change what's in @INC system wide so that both IDE (Eclipse) and CPAN know how to look. I've been doing a global file search for Makefile.PL with commands such as sudo find / -name "*.PL" | xargs grep "Makefile" in various case to try find it and try this recommendation, with no success so far. (Oh how I hate this OS :))

Recct
  • 913
  • 1
  • 16
  • 40

2 Answers2

1

I don't know the exact solution, may be this link will be helpful..

How is Perl's @INC constructed? (aka What are all the ways of affecting where Perl modules are searched for?)

Community
  • 1
  • 1
  • Under `sudo su` I started `# cpan` which it seems was a separate instance altogether, as It went through its initial setup as if you've just installed perl. I could install modules from that `cpan` I installed `HTML::HeadParser`. Normal CPAN (that is, `$ sudo cpan`) works now. Not a solution though I'd still like to know how to tinker with the global `@INC` :/ – Recct Mar 12 '13 at 12:36
0

If $Config{usesitecustomize} is defined, you can look for sitecustomize.pl at $Config{sitelib}\\sitecustomize.pl. See perlrun.

%Config variables tell you how perl has been compiled to run, so a re-compile would be necessary to change that.

Barring that, you could also alter any universal login scripts that are run--if any--so that the environment variable PERL5LIB contains your path--and I believe that the environment variable PERLLIB still works as well.

Axeman
  • 29,660
  • 2
  • 47
  • 102