If the Perl program is started from your shell script and you want to let it return data to that shell script, setting environment variables won't do you any good. A child process (the Perl program) cannot alter it's parent's (ht e shell script) environment!