Modifying @INC

From: Perldiscuss - Perl Newsgroups And Mailing Lists (shahj_at_india.hp.com)
Date: 07/29/04


Date: 29 Jul 2004 05:14:45 -0000
To: beginners@perl.org

I want to add some paths to the @INC array to resolve certain package
names at runtime.

One of the methods is: "push(@INC,$path) or unshift($path,@INC)" and then
say "require package_name;".
the problem with this is that we still need to use the "::" operator with
the symbols to resolve the package namespace.
eg: package_name::test_sub();

The other method that I came across was to use the PERL5LIB/ PERLLIB
environment variable. This actually needs us to create an OS level env
variable, which I would like to avoid.

Apart from these is there a method that can modify @INC at runtime.



Relevant Pages

  • Re: why debian - longer
    ... does not preclude one from learning how to resolve issues. ... spending hours fixing problem A, fixing problem B, fixing problem C, fixing ... The absense of a package ... manager does not instantly qualify someone to resolve any issue. ...
    (Debian-User)
  • RE: Modifying @INC
    ... > with the symbols to resolve the package namespace. ... "use lib" pragma in conjunction with the FindBin module to locate your ... avoid hard-coding entries into @INC. ...
    (perl.beginners)
  • FC4 -> FC5 yum upgrade : failed dependencies i dont know how to resolve
    ... As the DVD won't boot properly on this one PC, I decided to upgrade my system by using the package manager yum. ... I did resolve many of them by simply uninstalling the packages that could not be satisfied. ... Error: Missing Dependency: libgnutls.so.11 is needed by package videolan-client ... Does anyone of you have an idea how to resolve that dependency without uninstalling all of the X11 software? ...
    (linux.redhat.install)
  • YUM ERROR
    ... Could anyone please help me to resolve following error: ... needed by package mplayer-gui ...
    (comp.os.linux.misc)
  • Re: Report Builder and PDFs?
    ... For the demo you can disable the other package which has ZLIB in it. ... James Waler ... >I can edit while installing might resolve such conflicts. ...
    (borland.public.delphi.thirdpartytools.general)