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

I'm currently writing a Perl script that executes a program (rclone specifically).

Many instances of the script can run simultaneously, so I require the functionality GNU parallel offers--namely, the ability to act as a "counting semaphore" while also limiting system resource usage (which GNU parallel offers).

GNU parallel is written in Perl (in fact the program is just an enormous Perl script). In order to use it however, I would have to call system-(can't use do as the program would cause my script to quit/exit early)--or is there a better way (btw I don't how to write the relevant bits of GNU parallel's functionality into my script)?. I don't think there are any modules I can use to replicate GNU parallel's functionality (i.e. do any exist?).

See my StackOverflow question for more details. Note the SO question itself only lead me to conclude that I should probably use GNU parallel. I really don't know of an appropriate way to implement it, however----or if there is a better/cleaner way.

Replies are listed 'Best First'.
Re: Using GNU Parallel (a Perl script) inside a Perl script?
by Corion (Patriarch) on Dec 04, 2017 at 19:24 UTC