Just a few thoughts on your pseudo-code:
my $chunks = $length/ #divided by how ever many chunks you want
This would seem to give you a chunk length rather than a number of chunks, but you are subsequently iterating over $chunks as if it were a number of chunks.
foreach (0 .. $chunks){
...
}
This gives an off-by-one error if $chunks is the number of chunks over which you want to iterate. Either
foreach (0 .. $chunks - 1) { ... }
or
foreach (1 .. $chunks) { ... }
would seem to do a better job (if knowing the chunk index is not an issue).
In reply to Re^2: Foreach/While - Why does this run AFTER that?
by AnomalousMonk
in thread Foreach/While - Why does this run AFTER that?
by CalebH
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |