Jos I. Boumans wrote:

On 03 Sep 2007, at 21:25, John E. Malmberg wrote:
Finally, each test run for CPANPLUS is appending a path on to $ENV{PATH} AND $ENV{PERL5LIB}. As near as I can tell, it intends to clean these up, but that is not working on VMS. I have not figured out why yet. It does not take too many runs, and the PERL5LIB path gets so long that VMS arbitrarily breaks it into two elements, neither of which is a valid path on VMS.

Actually, it doesn't attempt to clean this up -- all OS's I know (and obviously, I don't know VMS ;) reset %ENV after they have exited, so there's no need to
worry about this.

Short story, Perl on VMS is not using environment variables to store
%ENV values by default, so there is a persistence mis-match.

I've added the following bit of code to the include file, right at the top to
make sure that %ENV gets reset to whatever it was it began with.

Hopefully, that solves the problem you're encountering on VMS.

--- t/inc/conf.pl       (revision 2238)
+++ t/inc/conf.pl       (local)
@@ -1,3 +1,12 @@
+### On VMS, the ENV is not reset after the program terminates.
+### So reset it here explicitly
+### Use a $^O comparison, as depending on module at this time
+### may cause weird errors/warnings
+{   my %old_env;
+    BEGIN { %old_env = %ENV }
+    END   { %ENV     = %old_env if $^O eq 'VMS' }
+}
+
 BEGIN {
     use FindBin;
     use File::Spec;

I do not think this will work.  The %ENV hash on VMS by default works
nothing like it does on UNIX.  Longer story is in the archives.

The patch I put in, is the safest one that I could come up with given
the issues involved.

I would not want to be doing a global save and restore of the %ENV hash
on VMS.  1. It is resource intensive.  2. It is dangerous, especially on
a privileged account.

$ENV{HOME} is magic on VMS, and Perl can not tell if it did not exist
before it was referenced, so we are limited in what we can do to restore
it to its previous value.  There are a few $ENV{} values like that.

For the Perl specific $ENV{} values that are modified by the script, it
is safe to save and restore/delete them on VMS.

For all other $ENV() values, you need to know what you are doing before
you change them.

-John
[EMAIL PROTECTED]
Personal Opinion Only


Reply via email to