in reply to Re^2: system ( "source $script" )
in thread system ( "source $script" )
This is not what I said.
You need to print the environment from within the new shell started by system() — e.g. with env, as shown. (But nothing keeps you from using Perl code to print out the environment, in case you don't like env's output: system ". $script && ./my_env_prettyprinter.pl" )
As soon as system() returns, the shell has terminated, and the new environment is gone with it. You cannot have a subshell set environment variables in a parent process, such as your Perl script, or the shell the Perl script has been started from, etc.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: system ( "source $script" )
by ajwood (Novice) on Jan 28, 2011 at 22:01 UTC | |
by Anonyrnous Monk (Hermit) on Jan 28, 2011 at 22:16 UTC | |
by JavaFan (Canon) on Jan 29, 2011 at 13:25 UTC | |
by eyepopslikeamosquito (Archbishop) on Jan 30, 2011 at 07:08 UTC |