At 6:58 PM -0500 10/1/07, John E. Malmberg wrote:
>Glenn Linderman wrote:
>
>>
>>Perhaps should be...
>>
>>BEGIN { %old_env = %ENV if $^O eq 'VMS' }
>>
>>>+    END   { %ENV     = %old_env if $^O eq 'VMS' }
>>>+}
>>>+
>
>No.  That could be catastrophic.

Indeed.  I'm not sure what all the fuss is about.  John wrote a
patch that does the right thing three weeks ago:

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2007-09/msg00391.html

It saves and restores only the PATH and PERL5LIB elements.  It only
does the restore on VMS, which is overly conservative, but doesn't
hurt anything.  Any other approach will cause trouble.  You do not
want to attempt to delete all of %ENV, and you do not want to attempt
to save and restore all of %ENV for reasons John has explained, and
those reasons could be elaborated further.


>In hindsight, it was probably a big mistake to have the C library and then 
>later Perl treat logical names as environment variables.  But it was done, and 
>programs are now dependent on that behavior, and there is not an easy way to 
>migrate over to a better behavior.

We could consider an option to have all updates to %ENV done as
user-mode logical names where the automatic destruction on image
run-down would more or less correspond to what happens on other
platforms.  Can't say it's high on my priority list, though.
-- 
________________________________________
Craig A. Berry
mailto:[EMAIL PROTECTED]

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

Reply via email to