in reply to Re: Re: Re: Foreach Complications
in thread Foreach Complications

arturo is correct. Look particularly at your use of (the same) $i and $id in the calling code and the subroutine.

my is your friend.