How is @INC path constructed?

L

Lax

Hi all,
Could someone give me a clue how the @INC path of a Perl installation
is constructed.
I'd installed a thirdparty package which was shipped with its own
version of Perl. Installing it put the software's bin folder in the
PATH variable first and it overrides any other Perl installation on the
machine.

The @INC path for invocation of any perl .exe from other installations,
always displays the package's bin first. Is there any way I could avoid
that from happening? The package's Perl is incompatible with a few of
my scripts.

I tried changing the system PATH env variable to put the desired Perl
installation bin folder first in the PATH. Even though, the PATH has
changed, the @INC doesnt seem to change.

I dont want to uninstall the software just on this account :)

Thanks for your time,
Lax
 
U

usenet

Lax said:
Could someone give me a clue how the @INC path of a Perl installation
is constructed.

It's constructed when Perl is compiled. The only way to change it is to
recompile Perl and specify what you want. However, you may be
interested in alternatives:

perldoc -q @INC
How do I add a directory to my include path (@INC) at runtime?
 
B

Ben Morrow

Quoth "Lax said:
Hi all,
Could someone give me a clue how the @INC path of a Perl installation
is constructed.
I'd installed a thirdparty package which was shipped with its own
version of Perl. Installing it put the software's bin folder in the
PATH variable first and it overrides any other Perl installation on the
machine.

The @INC path for invocation of any perl .exe from other installations,

Given ^^^^, I'm assuming you're on
Win32, in which case perl (or at least, AS perl) will read some extra
entries for @INC from the registry, under HKLM\Software\Perl; all
versions of perl will also add entries to @INC from the PERLLIB and
PERL5LIB environment variables. It's possible this 3rd party piece of
software has set one of those up for itself; I would consider this a bug
in that piece of software.
I tried changing the system PATH env variable to put the desired Perl
installation bin folder first in the PATH. Even though, the PATH has
changed, the @INC doesnt seem to change.

Just to check: can you post the results of

C:\> c:\full\path\to\MY\perl.exe -le"print for @INC"

and

C:\> c:\full\path\to\THEIR\perl.exe -le"print for @INC"

?

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top