Chances are that error is telling you 1) you need to assign the loop a AoH ref, or 2) you are assigning it an undefined value. At least this has been my experience in the last couple of weeks. It might be helpful to see your HTML.
—Brad
"A little yeast leavens the whole dough."