shadowman13 has asked for the wisdom of the Perl Monks concerning the following question:
I'm new to Perl, so don't know if there is a way to ceil the number of elements inside an array?
I got a task like below:
+Get a list of modules if number of modules is 8 ceiling(6/2)= ceiling(3)=3 -> call the first 3 modules on port 80 and call the last 3 modules on port 8080
+if there is 5 modules deployed -> ceiling(5/2)= ceiling(2.5)=3 -> call the first 3 modules on port 80 and call the last 3 modules on port 8080 (the module “in the middle” will be called twice)
Could you help me with an algorithm or a way to do this in perl?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Ceiling elements of an array!
by vinoth.ree (Monsignor) on May 06, 2015 at 08:45 UTC | |
by Happy-the-monk (Canon) on May 06, 2015 at 09:47 UTC | |
by shadowman13 (Initiate) on May 06, 2015 at 10:51 UTC | |
by Happy-the-monk (Canon) on May 06, 2015 at 12:03 UTC | |
|
Re: Ceiling elements of an array!
by hippo (Archbishop) on May 06, 2015 at 09:09 UTC | |
by shadowman13 (Initiate) on May 06, 2015 at 10:53 UTC | |
by AnomalousMonk (Archbishop) on May 06, 2015 at 22:09 UTC | |
|
Re: Ceiling elements of an array!
by pme (Monsignor) on May 06, 2015 at 09:10 UTC | |
|
Re: Ceiling elements of an array!
by GotToBTru (Prior) on May 06, 2015 at 15:41 UTC | |
by marinersk (Priest) on May 06, 2015 at 18:00 UTC | |
by AnomalousMonk (Archbishop) on May 06, 2015 at 22:48 UTC | |
by GotToBTru (Prior) on May 06, 2015 at 18:13 UTC | |
|
Re: Ceiling elements of an array!
by marinersk (Priest) on May 06, 2015 at 12:30 UTC | |
|
Re: Ceiling elements of an array!
by shadowman13 (Initiate) on May 06, 2015 at 13:15 UTC |