use Template; use YAML::XS qw( Load LoadFile ); use Cpanel::JSON::XS qw( decode_json ); ## This could be an external file, and/or make this a plugin argument that points to it. my $consts = Load( <<'EOT' ); --- PRE: 1 REGULAR: 2 POST: 3 EOT ## Alternately my $alternate = decode_json( <<'EOT' ); {"PRE": 1, "REGULAR": 2, "POST": 3, "Foo": "Bar" } EOT my $template = Template->new({ CONSTANTS => { y => $consts, j => $alternate }, CONSTANTS_NAMESPACE => 'C', }); __END__ [% IF type == C.j.REGULAR %] Blah blah I R REGULAR stuff. But JSON says foo is '[% c.j.Foo %]' [% END %]