in reply to Setting the path when a module installs
Note that you can only set the environment variables for your child processes and not for your parent process (unless you're on Win32).
So if you're running child processes (like a C compiler) from your Makefile.PL, the following will work:
use Config '%Config'; my $allegro_dir = '/usr/local/bin/'; $ENV{PATH} .= ":" . $allegro_dir; ...
The following won't do what you want though:
`PATH=$ENV{PATH}:$allegro_dir`;
because that will launch a child process, which sets the PATH environment variable and then ends. And the changes are gone with the end of the child too.
|
|---|