in reply to Modifying ENV variable of parent process

If I understand you question correctly, you could attempt a solution where you run ksh from backticks, and have ksh tell you what it's environment is. For example:

{ my @lines = `/bin/ksh -c ". oraenv -d; set"`; for (@lines) { next unless /=/; my($k,$v) = split /=/, $_, 2; $ENV{$k} = $v; } }

That should call /bin/ksh so it runs the script and then it has /bin/ksh run set, which dumps all the variables of the shell, and the results of the set should then be parsed and inserted into %ENV

I forewarn that that code is untested.