in reply to foreach returning to start of array

Actually, that is what you're doing - restarting the the looping through the @requests array. Every time a foreach is encountered, it starts at the beginning of the array.

Solution - associate the data within each email with the address it's supposed to go to. (Hashes are associative arrays, in case you're wondering.)

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

  • Comment on Re: foreach returning to start of array