use Types::Standard -types; use Template::Compiled; my $template = Template::Compiled->new( signature => [ name => Str, age => Int->plus_coercions(Num, sub { int $_ } ), ], template => '
Hi = $name ?>. You are = $age ?> years old.
', escape => 'html', ); # The number will be rounded. # The ampersand will be escaped properly. # print $template->( name => 'Alice & Bob', age => 45.1 );