Well Cory, the reason that your variables get modified is that 'for' is synonymous with 'foreach' in perl. They are the exact same construct.
When you use commas instead of semicolons to delimit your for variables, you are telling the perl interpreter to treat the contents as a list instead of...