LPC2002 has asked for the wisdom of the Perl Monks concerning the following question:
I have an array with x number of elements (i.e. 64 elements)
Ergo, @array (contains 64 elements)
What I want to do is run through the array from the beginning and place the first 15 elements into a new array, then the next fifteen into a new array, and so on and so forth, so I am left with
So the 64 elements have been split into new arrays.@array1 [0..14] @array2 [15..29] @array3 [30..44] @array4 [45..59] @array5 [60..63]
I am sure this is do-able, I am not sure how. I have only been coding in Perl for about 8 months, so there is LOTS I don't know
Thanks :-)
update (broquaint): fixed code section and added formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array Issues
by dragonchild (Archbishop) on Aug 28, 2003 at 13:50 UTC | |
|
Re: Array Issues
by Abigail-II (Bishop) on Aug 28, 2003 at 13:52 UTC | |
by LPC2002 (Initiate) on Aug 28, 2003 at 14:23 UTC | |
by liz (Monsignor) on Aug 28, 2003 at 14:32 UTC | |
by dragonchild (Archbishop) on Aug 28, 2003 at 14:30 UTC | |
by antirice (Priest) on Aug 28, 2003 at 14:48 UTC | |
|
Re: Array Issues
by gjb (Vicar) on Aug 28, 2003 at 14:29 UTC | |
|
Re: Array Issues
by Zaxo (Archbishop) on Aug 28, 2003 at 15:23 UTC | |
|
Re: Array Issues
by kesterkester (Hermit) on Aug 28, 2003 at 14:34 UTC |