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.
Much of what is in the VMS %ENV table is logical names.
Now VMS logical names behave more like symbolic links and mount points
than they do environment variables. They are also used to hold
transient state information, and miscellaneous values. On a typical VMS
system, you can expect to have as many if not more logical names as you
would expect to have mount points and symbolic links combined on the
same sized of UNIX system.
Much of what logical names do on VMS are done on Windows by the Registry.
So taking a snapshot of %ENV and then restoring it later on VMS would be
about the same as taking a snapshot of the Windows registry and then
restoring it later.
Or on UNIX taking a snapshot of all the current symbolic links and mount
points, and then restoring it later.
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.
-John
[EMAIL PROTECTED]
Personal Opinion Only