in reply to Changing a unix users environment
Read system - the list form of system, which you rightfully use, needs every parameter as a single item, not delimited by spaces:
my $userdir = 'corion'; my $env_file = "/home/$userdir/bin/set_normal"; system("csh", "source", $env_file) == 0 or die "Couldn't source '$env_file': $! / $?";
But starting a shell which loads the environment into its memory and then exits again won't do what you want anyway, as all changes to the environment are lost once that shell terminates. See tilly's Get default login environment for the technique how to run a shell script and capture all changes to the environment in Perl.
|
|---|