you can but it doesn't make sense, since %ENV is by definition automatically exported.
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.
|