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. Here is the script that I am using: #!/usr/bin/perl -w use strict; require "/home/admin/psoft_vars/weblogic_vars.pl"; my $PS8PRD; my @PID; my $OLD_PID; &get_process; $OLD_PID = $PID[1]; system "/psoft/bin/ri_webserv.scr stop ps8prd"; sleep (60); system "/psoft/bin/ri_webserv.scr start ps8prd"; sleep (60); &get_process; print "Weblogic ps8prd process $OLD_PID successfully shutdown\n"; print "Weblogic ps8prd process successfully restarted as $PID[1]\n"; sub get_process { $PS8PRD = `ps -ef | grep /psoft/ps8prd/jre/bin/../bin/PA_RISC2.0/native_threads/java`; @PID = split (/\s+/, $PS8PRD); } 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. 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? Thanks, Craig A. Sharp Unix Systems Administrator DNS Administrator Roush Industries Office: 734-466-6286 Cell: 734-231-6769 Fax: 734-466-6939 [EMAIL PROTECTED] ==================================================== I have not lost my mind, it's backed up on tape somewhere! ==================================================== >>> "Jenda Krynicky" <[EMAIL PROTECTED]> 03/17/02 11:02AM >>> From: "Craig Sharp" <[EMAIL PROTECTED]> > In a shell programming, I can run a script with a period-space in > front of the script: > > Eg: . script_name.scr > > This will cause the variables to be sourced to the parent process. In > other words, any variables that are created within the child process > running the script become available to the parent process when the > child process completes. Without the period, the variables die with > the child process. > > If I use the system command: > > Eg: system ". script_name.scr" > > Will the variables be available to the perl script that called the > system command? No. Print them out, use `` instead of system() and parse the script's output. 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 _______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs