Your inner loop is iterating over all of the items in @list1, and even going well beyond the end of the list,
No it doesn't. It reads @list1 three at a time from start to end over and over again.
In reply to Re^2: faster way for multiple foreach loops
by ikegami
in thread faster way for multiple foreach loops
by michbach
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |