use Template; # some useful options (see docs below for full list) my %config = ( INCLUDE_PATH => '/search/path', # or list ref INTERPOLATE => 1, # expand "$var" in plain text POST_CHOMP => 1, # cleanup whitespace PRE_PROCESS => 'header', # prefix each template EVAL_PERL => 1, # evaluate Perl code blocks ); my $template = Template->new(\%config); my %params = ( var1 => $value, var2 => \%hash, var3 => \@list, var4 => \&code, var5 => $object, ); $template->process($input, \%params) || die $template->error();
To install Template, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template
CPAN shell
perl -MCPAN -e shell install Template
For more information on module installation, please visit the detailed CPAN module installation guide.