Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
June 27, 2008, 6:00 pm
rate this thread
PYTHON or ProgramFiles, I use the set command which output the
If I used Perl 5.003_07 and use the system subroutine to show the
environment variables, I get the following. Perl script is:
You'll notice that through system, the environment variable
ProgramFiles is all in upper case. Is there a way to preserve the
mixed case of the environment variable through system(...)?
Re: Using System to read mixed cased environment variables on Windows
I find that case is preserved with perl 5.6.2, 5.8.8 and 5.10.0:
C:\CVS>perl -e "system(\"set MyTest\")"
C:\CVS>perl -e "system(\"set MiTest\")"
Not quite sure why you get the behaviour you reported ... perhaps it
is just that antiquated version of perl you're running. I guess you
could update your perl and see if the behaviour changes. (Though as
Ron Bergin has already indicated, there are better ways of accessing
the environment variables anyway.)