Note that there are semi-colons between the expressions, not commas.
In this case, the OP has constructed a foreach loop iterating $_ over a list of three elements: $i=500, $i=900 , $i += 100, which evaluates to 500, 900, 1000 and $i set to 1000 for ALL iterations of the loop.
Alexander
In reply to Re^4: For loop trouble
by afoken
in thread For loop trouble
by cheech
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |