in reply to ENV INFORMATION

The following technique is what I use from time to time to set environment variables using Perl. The shell I am using is bash.

#!/usr/bin/perl -w # .setenv.pl use strict; ... ... my $var1 = 'a'; my $var2 = 'b'; ... ... print <<EOL; export VAR1=$var1 export VAR2=$var2 EOL exit(0);
The .setenv.pl script is called from a shell script, say, .setenv.sh.

#!/usr/bin/bash if [ -x ~/.setenv.pl ] then eval `.setenv.pl` fi


Then you source the shell script with the current shell by:

. ~/.setenv.sh


This will set the environment variables VAR1 and VAR2 permanently in the current shell.