Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Round robin processing

by siberia-man (Friar)
on Sep 09, 2019 at 20:20 UTC ( [id://11105907]=note: print w/replies, xml ) Need Help??


in reply to Round robin processing

This solution is almost similar to other ones supplied by other monks:
#!/bin/perl my @array = qw(1 2 3 4 5 6 7 8 9 10 11 12); my $data; my $div = 4; for my $i ( @array ) { my $j = $i % $div; push @{ $data->{$j || $div} }, $i; } use Data::Dumper; print Dumper \@array; print Dumper $data;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11105907]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2024-04-26 03:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found