in reply to Re: Yet another spawn question. Portable method?
in thread Yet another spawn question. Portable method?

My apologies for the missing question - updated.

As for the chain, each time a script is started, an integer is passed as an arg that indicates how many times the script can be spawned. Each spawn decrements the int. "perl spawn.pl 3" will cause 3 instances of the script to be spawned:

D:\Views Tests>perl spawn.pl 3 Starting PID 3616 as instance 3 Starting PID 5940 as instance 2 Starting PID 6064 as instance 1 PID 3616 ended D:\Views Tests>Starting PID 4564 as instance 0 PID 5940 ended PID 6064 ended PID 4564 ended

Replies are listed 'Best First'.
Re^3: Yet another spawn question. Portable method?
by LanX (Saint) on Sep 16, 2017 at 15:25 UTC
    > Each spawn decrements the int.

    Still, you are unnecessarily giving up control, like the possibility to kill the master and all children at the same time.

    see also perlipc

    This is not my field of expertise, but IMHO your requirement not to use extra modules will make this a rather complicated task.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!