By the way, when submitting code please at least show how your variables are derived. Many have said that the C-style for loop is unnecessary, but actually we do not know what $total_element is. We can only guess it is the highest index number in @run