in reply to shell script via perl (clarification)
In Perl, you access environement variables by their names as hash keys in %ENV, so you can easily manipulate them like so:
$ENV{PATH} = $ENV{PATH} . ":/home/toronto75/bin";
When you execute a shell script, it inherits the environment.
So would any other executable, so there's actually no need to call a shell script as a wrapper for that other executable.
Update: However, when that programme terminates, and in turn, the shell script terminates after having first modified the environment and than run that other programme, the environment does not remain modified as by the shell script.
To your Perl programme, nothing has changed, except what it did itself.
Cheers, Sören
|
|---|