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.


In reply to Using GNU Parallel (a Perl script) inside a Perl script? by YenForYang

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.