in reply to Getting environment variable of a process

my perl code and the application s/w runs independently

By "independently" I assume that the application is not the parent of your perl code. If that is the case then there is no way to get at the environment variables in an unrelated process on UNIX. The nearest I have come up with is to write a debugger and attach that to the application, but even then you need to know the start address of the environment block, which is harder than it sounds. Parsing memory until you get something that looks like an environment block is possible but not reliable.

If you are on Windows then there is a possible solution with Win32::EnvProcess, but it can be flaky depending on the version of the OS. Let the author know if you decide to take that route.

and inherits its parent ENV variable
Do you mean the ENV environment variable? This contains the name of the Korn shell start-up file (typically $HOME/.kshrc). Or do you mean the environment block exposed in Perl as %ENV?
  • Comment on Re: Getting environment variable of a process