>echo %VAR% %OS% >perl -e "print $ENV{var} %OS% >perl -e "use Win32; print Win32::ExpandEnvironmentStrings('%VAR%') Windows_NT