It's likely %ENV is tied (I am guessing) or has mechanism similar to tie associated with it to pass lookups to an underlying system call
That mechanism is called "magic". Tied variables are a specific kind (MG_TYPE) of magical variables.
%ENV appears to be magical only under shells where the lookup and expansion of environmental variables is a case-insensitve operation.
It is my understanding that %ENV is magical on all platforms. The magic translates access to %ENV into C library calls.
To see if %ENV is magical, run
perl -MDevel::Peek -e 'Dump \%ENV, 1'
On Windows, that outputs
SV = RV(0x183a4ec) at 0x2251d8 REFCNT = 1 FLAGS = (TEMP,ROK) RV = 0x225db4 SV = PVHV(0x229584) at 0x225db4 REFCNT = 2 FLAGS = (SMG,RMG,SHAREKEYS) IV = 29 NV = 0 MAGIC = 0x182a964 <---- MG_VIRTUAL = &PL_vtbl_env MG_TYPE = PERL_MAGIC_env(E) ARRAY = 0x18257cc (0:13, 1:11, 2:6, 3:2) hash quality = 102.6% KEYS = 29 FILL = 19 MAX = 31 RITER = -1 EITER = 0x0
I don't have access to a unix machine at the moment.
Perl probably doesn't even care whether the env vars are case-sensitive or not. That's probably handled by the C library or passed on the OS.
In reply to Re^4: Win32 GetEnvironmentVariables?
by ikegami
in thread Win32 GetEnvironmentVariables?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |