in reply to (tye)Re: Can @INC be modified using environment variables in Win?
in thread ADD PATH TO @INC

The current shipment of ActiveState (build 626) looks in HKLM\Software\Perl for values named PERL5OPT, PERL5LIB, PERLLIB, lib-5.6.1, lib, sitelib-5.6.1, and sitelib.

It also opens HKCU\Software\Perl many times, but doesn't check any values contained in it. Perhaps it only checks the Current User if it found something under Local Machine, but that seems a strange thing to do. It could just be buggy.

It does look at the location of the currently-run exe file, too, if it's in a /bin/ subdirectory (but not otherwise) and if the generated names actually exist.

—John

  • Comment on Re: (tye)Re: Can @INC be modified using environment variables in Win?

Replies are listed 'Best First'.
(tye)Re2: Can @INC be modified using environment variables in Win?
by tye (Sage) on Jun 20, 2001 at 01:07 UTC

    ...and does it find anything? With previous builds (I have 616 handy), the default install doesn't determine @INC from any values in the Registry and so the primary source for @INC for most users of Win32 Perl is determined from the location of the running perl.exe (or the Perl56.dll file, it appears).

    Putting the path in the registry would be a bad idea because it could easily lead to a new install of Perl telling an old install to use the new install's module directories. There are many good reasons to have multiple versions of Perl installed with independant module directories (for example, if you write modules, you want to have a few versions around for testing and sometime you want more than one install of Perl with the same value of $]).

    I don't try to keep up on the many, poorly documented details on this. But I'm often installing more than one version of Perl or using a Perl that was installed from a different operating system or was originally installed in a different location. I never make changes in the registry to get this working. I just make changes so that the right perl.exe is found.

    I always find Win32 Perl looking for its modules in the directory relative to where the perl.exe is. I never find it looking in a directory that it read out of the registry. Perhaps that has changed since build 616. If so, I think it was a mistake. /:

            - tye (but my friends call me "Tye")