This might be faster than your inner loop:
splice @arr, $from, $to-$from+1, map 1+$_, @arr[$from..$to];
...but I haven't tested it. If we had a full runnable example, we could do some Benchmarking.
In reply to Re: Optimizing a double loop
by kyle
in thread Optimizing a double loop
by roibrodo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |