[EMAIL PROTECTED] wrote: > 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.
If these are modules that are "private" to your program, you can use the "use lib" pragma in conjunction with the FindBin module to locate your modules relative to your script. perldoc FindBin perldoc lib If these are standard modules that you've installed in a non-standard location, use PERL5LIB instead of hard-coding paths into a "use lib" directive. Generally speaking, avoid hard-coding entries into @INC. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>