mndoci has asked for the wisdom of the Perl Monks concerning the following question:
This question is complicated in my mind, so I hope I put it down properly. Here is the scenario. I have a wrapper perl script which I use to set environmental variables and then start several processes. The first process is called by the following command (in the wrapper script)
system("$RUN_PROC1 $ARGV[0] $ARGV[1] $ARGV[2] $ARGV[3] $ARGV[4] $ARGV[5]");
where $ARGV[0] etc are command line flags and paths/filenames, and are then passed on to the subsequent script ($RUN_PROC1)which uses them to do some file processing and run some executables.
I want to follow this command with another, similar command
system("$RUN_PROC2 $ARGV[0] $ARGV[1] $ARGV[2] $ARGV[3] $ARGV[4] $ARGV[5]");
Will the command line parameters be passed on correctly? The two processes are separate perl scripts and use the SAME files etc pointed to by the command line parameters.
For example, I have certain files that use the value of $ARGV[5], put it into a variable called $RUN_NAME and then append $RUN_NAME to a filename. I want to retain $RUN_NAME between PROC1 and PROC2.
Additionally I would like to retain and pass some PID's ($$)between PROC1 and PROC2.
I am not too sure about how to do this. Please not that there are subesequent processes which I would like to call from the wrapper script, which may share certain variables, although I do not think I will need to continue passing on the command line variables. If anyone can point me in the right direction it would be great. I have been looking at the IPC::Shareable module, but I am not sure that will do it.
Thanks mndoci "What you do in this world is a matter of no consequence. The question is, what can you make people believe that you have done?"-Sherlock Holmes in 'A study in scarlet'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing command line variables and PID's between processes
by merlyn (Sage) on May 30, 2001 at 02:34 UTC | |
|
Re: Passing command line variables and PID's between processes
by clintp (Curate) on May 30, 2001 at 02:36 UTC | |
|
Re: Passing command line variables and PID's between processes
by IraTarball (Monk) on May 30, 2001 at 02:58 UTC | |
by mndoci (Scribe) on May 30, 2001 at 03:20 UTC |