in reply to Getting environment variable of a process
Which platform are your applications running on?
On Linux, inotify may be helpful; see Linux::Inotify2