I tried to conquer this a while ago, and I realized that perl, when doing anything involving the shell, sub-shells and leaves you with squat. You can find a recent discussion: Returning cron. It seems that kshelling is the best way to go on this.
Comment on Re: Sourcing Dot Profiles for Run-Time Application Configuration
I recently encountered this problem. I solved it by running (in backticks) the shell script followed by printenv, which prints all the environment variables, and looping through the output setting the environment with %ENV.