O
OdedDV
Hello all,
I have a rather long Perl script (which is Tk based). The script needs to
run another instance per user request. It is currently done using `system
myscript param1 param2 param3 &`. This works great in terms of
functionality, but the issue is that myscript gets "compiled/interpreted"
over and over whenever a new instance is required. This is a waste of time,
especially on some of our slow Solaris machines.
I wanted to convert myscript to a module, such that I can write another
short script which will use this module to launch the first instance.
It means that the module itself would have a function which launches another
instance.
The issue I'm facing is regarding the global variables I have in the script.
Naturally every instance should have its own copy of the parameters. It
means I can no longer have these as global parameters in the module, as this
implies that they are shared across all instances created. Trying to move
them to the "main" function I export from the module is no good, as I have
dozens of other functions in this module which need to access those
used-to-be "global" parameters.
Can someone please share with me some ideas / point me to relevant
documentation for the simplest way for me to achieve what I need ?
Maybe there's another solution (not using a module) ?
Thanks in advance,
Oded
I have a rather long Perl script (which is Tk based). The script needs to
run another instance per user request. It is currently done using `system
myscript param1 param2 param3 &`. This works great in terms of
functionality, but the issue is that myscript gets "compiled/interpreted"
over and over whenever a new instance is required. This is a waste of time,
especially on some of our slow Solaris machines.
I wanted to convert myscript to a module, such that I can write another
short script which will use this module to launch the first instance.
It means that the module itself would have a function which launches another
instance.
The issue I'm facing is regarding the global variables I have in the script.
Naturally every instance should have its own copy of the parameters. It
means I can no longer have these as global parameters in the module, as this
implies that they are shared across all instances created. Trying to move
them to the "main" function I export from the module is no good, as I have
dozens of other functions in this module which need to access those
used-to-be "global" parameters.
Can someone please share with me some ideas / point me to relevant
documentation for the simplest way for me to achieve what I need ?
Maybe there's another solution (not using a module) ?
Thanks in advance,
Oded