http://www.perlmonks.org?node_id=1006486


in reply to Building a local perl to use the system perl's libraries as a fallback

Can you explain what are you trying to achieve? You can add path to system libraries to @INC, and your local perl will search for modules there, but if you use different compilation options for local perl it may not be compatible with system libraries, and if you use the same options, then why don't just use system perl?

Replies are listed 'Best First'.
Re^2: Building a local perl to use the system perl's libraries as a fallback
by clueless newbie (Curate) on Nov 30, 2012 at 15:58 UTC

    On a fresh install of Ubuntu 12.10, I have NOT been able to install padre or Devel::ptkdb successfully from CPAN. But if I use Ubuntu's apt-get both install and work without any problems. Since "mucking" about with the system perl is considered "not the thing to do", I want to create a user perl that takes advantage of the successfully installed modules of the system perl.

    Moritz brings up an excellent point and I would be careful to configure the local perl with the options of the system perl.

    As I understand it, modules installed from CPAN via the local perl would not pollute the libraries of the system perl.

      You may have to install headers of the libraries XS code uses (i.e. simply speaking, files in /usr/include/ which point to the functions defined in *.so files). For example, building Wx from CPAN requires libwxgtk2.8-dev to be installed.
      Sorry if my advice was wrong.
      If you just want to be able to install modules into your home directory without touching the system libraries, you probably should have a look at local::lib. I don't use it myself, but I recall that system cpan command suggested to configure it automatically during first run on Ubuntu.