U
usenet
This would not be difficult to code, but I suspect there's a good
module out there. However, my CPAN search skills have proven inadequate
to locate it.
I want to iterate over an array, selecting "n" elements at a time
(where "n" is an arbitrary number), something like:
foreach my @three_elements ( ?something?(1..10, 3) ) {
# @three_elements has three numbers in it
}
As the loop iterates, @three_elements would be:
(1,2,3)
(4,5,6)
(7,8,9)
(10,undef,undef)
It would not be difficult to code, but I have grasped the concept of
code reuse. Can someone kindly direct me to a module which does
something like this? I really think that such a module must exist - it
seems a common enough task.
module out there. However, my CPAN search skills have proven inadequate
to locate it.
I want to iterate over an array, selecting "n" elements at a time
(where "n" is an arbitrary number), something like:
foreach my @three_elements ( ?something?(1..10, 3) ) {
# @three_elements has three numbers in it
}
As the loop iterates, @three_elements would be:
(1,2,3)
(4,5,6)
(7,8,9)
(10,undef,undef)
It would not be difficult to code, but I have grasped the concept of
code reuse. Can someone kindly direct me to a module which does
something like this? I really think that such a module must exist - it
seems a common enough task.