# Due to having to iterate through a lot of values, but also needing to perform further calculations, I must save the results of the iteration like this: $UserInfo->{"RemainingDays".$_."-".$UtilRatioPercent} = $RemainingTime; # $_ can either be NEW or ASSIGNED $UtilRatioPercent is variable. # The hash in which this is written is transferred to the template like so: $vars->{'ReturnValues'} = \@ReturnValues; # And then processed in the template as follows: [% FOREACH TimeData IN ReturnValues %] [% TimeData.RemainingDaysNEW-XX %] [% END %] #### [% TimeData.RemainingDaysNEW-75 %]