Perl environment FAQ: How do I set environment variables in Perl programs?
In several other articles, we've demonstrated how you can access the value of environment variables from your Perl programs. For example, to determine the setting of your "PATH" environment variable, you can just do something like this:
$path = $ENV{'PATH'};
As you may remember, %ENV is a special hash in Perl that contains the value of all your environment variables.