in reply to Re: Round robin processing
in thread Round robin processing

Thanks for those ideas. That's interesting, I thought about modulo but wasn't sure how to use it , because remainder is often 0 : e.g. : 8%1 , 8%2, 8%4 all have a remainder of 0.

Replies are listed 'Best First'.
Re^3: Round robin processing
by jcb (Parson) on Sep 09, 2019 at 17:26 UTC

    The remainder being 0 is not really a problem and is needed for the solutions presented thus far, because all of them are using arrays to store the bins instead of using a hash. Arrays in Perl are indexed using numbers starting at 0, so it "just fits" and also mean that the bins are always in a known order instead of the random order that your initial code produces.

Re^3: Round robin processing
by bliako (Abbot) on Sep 10, 2019 at 15:31 UTC

    those with a remainder of 0 will go to bin 0, i.e. the first slot in the bins array.