|Just another Perl shrine|
Re: I need to export variable as another userby moritz (Cardinal)
|on Aug 06, 2012 at 12:18 UTC||Need Help??|
The error messages don't match the script you have posted (maybe there's more to the script, and the part that you haven't shown us causes problems?)
Also please read the documentation of system. It doesn't do what you seem think it does.
Also lines like my $bash_profile_run = system(". /home/mrdemo1/pig_profile_tmp); are pointless. The sourcing of the pig_profile_tmp happens only in the subshell that system has spawned for you. And then that subshell exits, and you lose all changes that pig_profile_tmp made to the environment.