This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fixes to allow win32 Perl to properly handle PERL5LIB.
authorPhil Monsen <philip.monsen@pobox.com>
Tue, 19 Jul 2011 03:16:55 +0000 (22:16 -0500)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 19 Jul 2011 04:58:13 +0000 (21:58 -0700)
commit1fcb0052e32fe8c260e83b2ece033e2ca2f30a92
treedfcda30a0ccb54fa4f2946bf529af84f664801c5
parentcd197e1e6cdf55043b0cf56f5dbe8fc0c5426002
Fixes to allow win32 Perl to properly handle PERL5LIB.

On Windows Vista, 7 and 2008, the win32 API call
GetEnvironmentVariableA() does not return environment values
with string length of greater than 32766, even though
such variables are supported in the environment.

This consequently caused @INC not to be populated for
such values of PERL5LIB on those OSes, as reported in
RT #87322.

This commit reworks the code so that GetEnvironmentStrings()
is called if GetEnvironmentVariableA() indicates the requested
value is set in the environmtn.  The old fallback of consulting
the registry for variables beginning with "PERL" is retained, but
as a last-ditch fallback rather than the only recourse.

A new test file, t/win32/runenv.t has been added to validate
that the new behavior is working properly, as well as that
general environment variable handling is in accordance with
expectations, since t/run/runenv.t does not run on Win* platforms.
The new test file is essentially a non-forking clone of
t/run/runenv.t, with modifications to test cases to run properly
on Win* platforms, and with a new test case to test the new behavior.
MANIFEST
pod/perldelta.pod
t/win32/runenv.t [new file with mode: 0644]
win32/win32.c