string/list division

2005-03-28 Thread Juerd
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) { ... } #

Re: string/list division

2005-03-28 Thread Luke Palmer
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