srinikar has asked for the wisdom of the Perl Monks concerning the following question:

I need to write a script(let's say "123.pl") which can install itself as a ".exe" on Windows and as a process on Unix. Other multiple custom scripts make a call to this script 123.pl with various parameters and arguments aysnchronously/adhoc basis. I then need to write further code inside this script 123.pl which will process these parameters and arguments. My question is, how can my script capture these arguments and process them, since my script will be called adhoc / asynchronously? Also, if there are two or three calls from other custom scripts simultaneously, there need to be as many instances of my script running and processing these parameters. Many thanks in advance.
  • Comment on How to capture parameterts passed asychronously to a script

Replies are listed 'Best First'.
Re: How to capture parameterts passed asychronously to a script
by daxim (Curate) on Jun 19, 2012 at 13:14 UTC
    install itself as a ".exe" on Windows
    pp
    how can my script capture these arguments
    Getopt::Long
    if there are two or three calls from other custom scripts simultaneously, there need to be as many instances of my script running and processing these parameters
    The operating system already takes care of that, this is the default model for processes, so you do not need to do anything special.
Re: How to capture parameterts passed asychronously to a script
by Neighbour (Friar) on Jun 19, 2012 at 13:14 UTC
    The variable you're looking for is @ARGV. See also perlvar
Re: How to capture parameterts passed asychronously to a script
by Corion (Patriarch) on Jun 19, 2012 at 13:22 UTC

    If you want a single "server" process to minimize startup costs, consider looking at PPerl. It mostly works under Unix, Windows support is likely spotty. Your list of requirements is confusing, so maybe you can help us by telling us what kind of problem you are trying to solve.

Re: How to capture parameterts passed asychronously to a script
by Anonymous Monk on Jun 19, 2012 at 13:18 UTC
Re: How to capture parameterts passed asychronously to a script
by Anonymous Monk on Jun 19, 2012 at 23:22 UTC

    Hi,

    Have you thought of a library of sub-routines that you can 'use' from all these other programs?

    Then it's just a matter of passing values/references to and from sub-routines. Which I'm sure you already know how to do.

    J.C.