How about a little more information about what you are trying to do? Because it does look like you are creating variables, people_1, people_2, people_3, people_4, people_5, people_6, but you are not assigning any value to them.
ALso, elseif $k == 2, 3, or 4 ? What do you want to do there??