From: "Craig Sharp" <[EMAIL PROTECTED]> > Jenda and Bill, > > Ok, I went out and generated a list of the environment variables and > created a file with the entries as follows (just a few lines): > > $ENV{'PS_HOME'}='/psoft/ps8prd' unless (defined $ENV{'PS_HOME'}); > $ENV{'PS_JRE'}='/psoft/ps8prd/jre' unless (defined $ENV{'PS_JRE'}); > $ENV{'PS_PLT'}='HPUX_11_00' unless (defined $ENV{'PS_PLT'}); > $ENV{'PS_TUXDEV'}='/dev/null' unless (defined $ENV{'PS_TUXDEV'}); > > I am using a require statement to load the variables. I did not think > that making a module would be the correct way to handle the variables.
I think this is fine. > I have two questions: > > 1. Since I am using the call "use strict", do I need to have a "my" in > front of the env variable in the require file? It appears to load the > variables as requested and the strict does not seem to be applied to > the require file. No you can't put my there. If you put a my() in front of a variable in a file you require then you will NOT be able to access the variable. It will be only defined within the file. Besides you can't "my" a global variable like %ENV; > 2. When I make the sytem call to the external script, are the env > variables available to the script being run under the system call > since I have set them in the require file? Yes. The programs you start inherit your %ENV. Jenda =========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ========== There is a reason for living. There must be. I've seen it somewhere. It's just that in the mess on my table ... and in my brain. I can't find it. --- me _______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs