#Inline Perl [% PERL %] my $result = $stash->get('result'); my ($orig_attmpt, $orig_compl, $term_attmpt, $term_compl) = ($result =~ /Summary.*(\d)\s+(\d)\s+(\d)\s+(\d)/ ); if (($orig_compl/$orig_attmpt) > 0.95) { print 1; } else { print 0; } [% END %] OR #More Advanced Template [% matches = result.match('Summary\s+(\d)\s+(\d)\s+(\d)\s+(\d)') %] [% IF match.2/match.1 > 0.95 %]1[% ELSE %]0[% END %]