Template-Plex
view release on metacpan or search on metacpan
examples/experiment.pl view on Meta::CPAN
use feature ":all";
use strict;
use warnings;
#use strict;
#no warnings "uninitialized";
use Template::Plex;
use Data::Dumper;
use File::Basename qw<dirname>;
my @items=qw<eggs watermellon hensteeth>;
my $hash={
examples/html.pl view on Meta::CPAN
use strict;
use warnings;
use feature ":all";
use File::Basename qw<dirname>;
use Template::Plex;
my $root=dirname __FILE__;
my %hash=(title=>"hello");
my $template=Template::Plex->load("html.plex"=>\%hash, root=>$root);
examples/recursive.pl view on Meta::CPAN
use strict;
use warnings;
use feature ":all";
use File::Basename qw<dirname>;
use Template::Plex;
my %hash=(title=>"hello");
my $root=dirname __FILE__;
my @options=(root=>$root);
lib/Template/Plex/Internal.pm view on Meta::CPAN
$args//={}; #set to empty hash if not defined
chomp $data unless $options{no_eof_chomp};
# Perform inject substitution
#
_subst_inject($data, root=>$root) unless $options{no_include};
# Perform superfluous EOL removal
#
_block_fix($data) unless $options{no_block_fix};
#use feature ":all";
#say STDERR $options{file};
# Only do an init fix if the file has plex|plx in the name
# of if it is an array?
if($options{file}=~/\.plex|\.plx|^ARRAY/){
# Actually a template
#say STDERR "ACTUAL TEMPLATE $options{file}";
_init_fix($data) unless $options{no_init_fix};
}
else {
#say STDERR "NOT ACUTALLY A TEMPLATE $options{file}";
t/relative.t view on Meta::CPAN
use strict;
use warnings;
use Template::Plex;
use Test::More;
#use Data::Dumper;
#use feature ":all";
{
my $template="hello";
my $t=Template::Plex->load([$template],{});
ok(defined($t), "Load relative literal");
#say STDERR Dumper $t->meta;
}
{
( run in 0.845 second using v1.01-cache-2.11-cpan-cba739cd03b )