It was a matter of time, of course, after my last thread.
How often do we want chunks of a string or list? And how often do we
abuse a temporary copy and substr/splice for that?
What if instead of
my @copy = @array;
while (my @chunk = splice @copy, 0, $chunksize) {
...
} #
Juerd writes:
What if instead of
my @copy = @array;
while (my @chunk = splice @copy, 0, $chunksize) {
...
} # ^1
Well, I for one never write that. I very seldom use splice.
we could just write
for @array [/] $chunksize - @chunk { ... }
Well, we could also