Perhaps so, but there's no quick fix then, because $data{ value } is trying to do too many jobs -- it seems to contain a formula for setting itself which then destroys the formula if needed for subsequent iterations. I think at this point a functional description of the requirement is needed before diving into any solution.