Wednesday, May 11, 2011

How to Access Environment Variables in Perl Using %ENV

Environment VariableDescription
$ENV{USERNAME}The user name used to log in.
$ENV{PROMPT}The prompt (ex: $p$g).
$ENV{PROCESSOR_IDENTIFIER}A string with information on your CPU (ex: x86 Family 5 Model 2 Stepping 12, GenuineIntel).
$ENV{PROCESSOR_ARCHITECTURE}Indicates the family of your CPU (ex: x86).
$ENV{OS}A string with the name of the OS (ex: Windows_NT).
$ENV{HOMEDRIVE}Letter of the home drive (ex: C:).
$ENV{INCLUDE}Path of the include.
$ENV{CPU}Kind of CPU (ex: i386).
$ENV{SYSTEMROOT}The place of Windows (ex: c:\WINNT).
$ENV{COMSPEC}The place of the command interpreter (ex: c:\WINNT\system32\cmd32.exe).
$ENV{PATH}The system path.
$ENV{PROCESSOR_REVISION}CPU revision information (e.g., is your Pentium buggy?).
$ENV{USERPROFILE}Path of the profile for the current user.
$ENV{COMPUTERNAME}Name of the computer (ex: UC651).
$ENV{HOMEPATH}Your home directory path (ex: /users/bill).
$ENV{USERDOMAIN}Name of the domain you logged into.
$ENV{PROCESSOR_LEVEL}Level of CPU in its family.
$ENV{OS2LIBPATH}Path for the OS2 library.
$ENV{SYSTEMDRIVE}Letter of the system drive.

No comments: