in reply to Re^2: setenv in perl
in thread setenv in perl
lanx@ubuntu:~$ perl -E '$ENV{TEST}=TRUE; say `echo \$TEST` ' TRUE
Again, you can only effect the child process.
( update: please note you have three different processes in this example: ~$ Bash > Perl -E '...' > `Bash` )
If you want to effect the parent process, you need to return text information which is either eval'ed or source'd (when put into a file).
lanx@ubuntu:~$ eval `perl -E 'say q{export TEST=TRUE}'` lanx@ubuntu:~$ echo $TEST TRUE
In other words the parent process always keeps full control of the environment.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
|
|---|