in reply to EXPORT variables
$ENV{PATH} = "/home/abc/xyz/bin:$ENV{PATH}";
It will only affect programs you call from that perl script.
The standard way of altering your caller's environment is to emit shell code, and evaluate that:
# my_env.pl #!/usr/bin/perl print q{export PATH=/home/abc/xyz/bin:$PATH}, "\n"; # and this is how you call it: $ eval `./my_env.pl`
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: EXPORT variables
by sonalig (Acolyte) on Jun 09, 2008 at 23:30 UTC | |
by chrism01 (Friar) on Jun 10, 2008 at 05:55 UTC | |
by cdarke (Prior) on Jun 10, 2008 at 07:47 UTC |