RenardBleu has asked for the wisdom of the Perl Monks concerning the following question:

Hi Id like to add a path to lib path. I want it to be done for the whole system and for the whole users. As far, i only found solutions with push(@INC, invocating the scripts with -I option or setting environnment variables (in .bashrc or with export)... Thx in advance

Replies are listed 'Best First'.
Re: Adding a lib path to perl
by LanX (Saint) on Jan 07, 2014 at 09:15 UTC
    TIMOTOWTDI, search for "INC" or "lib" in perlrun

    e.g.

    -f Disable executing $Config{sitelib}/sitecustomize.pl at sta +rtup. Perl can be built so that it by default will try to execut +e $Config{sitelib}/sitecustomize.pl at startup. This is a h +ook that allows the sysadmin to customize how perl behaves. It can + for instance be used to add entries to the @INC array to make +perl find modules in non-standard locations.

    But I suppose most sys-admins (if they don't provide an own build) just adjust the default ENV of the users.

    updates

    site_perl

    running perl -V shows me that my system perl was build with /usr/local/lib/site_perl as last entry in @INC.

    This points to a yet not existing directory.

    Populating or linking should help customizing your system's Perl.

    older discussions

    HowTo search: "system wide Adding a lib path to perl"

    Add directry to @INC system wide

    http://stackoverflow.com/questions/2518679/how-can-i-add-a-directory-to-the-perl-library-path-at-the-system-level

    Cheers Rolf

    ( addicted to the Perl Programming Language)

      Thanks a lot Rolf. the "/usr/local/lib/site_perl" did the trick :)