http://www.perlmonks.org?node_id=1041349


in reply to Index number repeating in for loop

You are confusing assignment and comparison.