Do you by chance run this under
mod_perl? For security reasons you then have an almost empty environment.
From the docs:
ENVIRONMENT
Under CGI the Perl hash %ENV is magical in that it inherits environment variables from the parent process and will set them should a process spawn a child. However, with mod_perl we're in the parent process that would normally setup the common environment variables before spawning a CGI process. Therefore, mod_perl must feed these variables to %ENV directly. Normally, this does not happen until the response stage of a request when PerlHandler is called. If you wish to set variables that will be available before then, such as for a PerlAuthenHandler, you may use the PerlSetEnv configuration directive:
PerlSetEnv SomeKey SomeValue
You may also use the PerlPassEnv directive to pass an already existing environment variable to Perl's %ENV:
PerlPassEnv SomeKey
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law