It's true that hash keys are case-sensitive for normal hashes, but %ENV is magical.
>perl -e "print $ENV{OS} Windows_NT >perl -e "print $ENV{os} Windows_NT
Furthermore, the correct usage of Win32::ExpandEnvironmentStrings is Win32::ExpandEnvironmentStrings('%VAR%').
>perl -e "use Win32; print Win32::ExpandEnvironmentStrings('OS') OS >perl -e "use Win32; print Win32::ExpandEnvironmentStrings('%OS%') Windows_NT >perl -e "use Win32; print Win32::ExpandEnvironmentStrings('OS=%OS%') OS=Windows_NT
There is a difference between %ENV and Win32::ExpandEnvironmentStrings.
>echo %VAR% %OS% >perl -e "print $ENV{var} %OS% >perl -e "use Win32; print Win32::ExpandEnvironmentStrings('%VAR%') Windows_NT
Update: Added 2nd and 3rd para.
In reply to Re^2: Win32 GetEnvironmentVariables?
by ikegami
in thread Win32 GetEnvironmentVariables?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |