Scalar value @total[-1] better written as $total[-1] at ...