Rewrite the loop body for the obvious reasons, of course.
In reply to Re: the last added element of a hash by parv in thread the last added element of a hash by Lennotoecom