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

I would like to know where there is a tutorial on fork(); I have a little pet project where I want to use Net::FTP and fork several processes to act as clients, but I have no idea how to control how many forks happen at one time. For instance, I would like to ftp 50 files but only ftp 5 at a time. When any 1 ftp ends I would like a new one to take its place. Anyway, I would just like someone to point me in the right direction. Thanks.

Replies are listed 'Best First'.
Re: Fork me
by joealba (Hermit) on Nov 08, 2001 at 00:24 UTC
    Check out this node. With some help from past posts, I posted some easy to follow sample code using ForkManager. It rocks, and I'll never program straight forks again now that I know how to use it!

    And don't forget to check SuperSearch before you post a question. I've seen maybe 4 forking questions in the last week. :)
Re: Fork me
by drfrog (Deacon) on Nov 08, 2001 at 00:06 UTC
Re: Fork me
by Rex(Wrecks) (Curate) on Nov 08, 2001 at 00:12 UTC
    Hmm... I keep saying this on PM, check out Network Programming with Perl It's a really good book and does exactly what you are asking and more

    I really should get royalties for pimping this thing so much :)

    "Nothing is sure but death and taxes" I say combine the two and its death to all taxes!
Re: Fork me
by kschwab (Vicar) on Nov 08, 2001 at 01:54 UTC
Re: Fork me
by belg4mit (Prior) on Nov 08, 2001 at 23:11 UTC
    Check out Proc::Queue. Very cool module that does *exactly* what you seek.