Skip to content

Instantly share code, notes, and snippets.

@mackee
Created June 9, 2013 07:13
Show Gist options
  • Save mackee/5741498 to your computer and use it in GitHub Desktop.
Save mackee/5741498 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Data::Section::Simple qw/get_data_section/;
use Text::Xslate;
use DDP;
my $vpass = get_data_section();
my $tx = Text::Xslate->new(
path => [ $vpass ]
);
print $tx->render('foo.tx', { title => 'aaaa' });
use Text::MicroTemplate qw/render_mt/;
print render_mt($vpass->{'bar.mt'}, { title => 'aaaa' });
__DATA__
@@ foo.tx
<!doctype html>
<html>
<body><: $title :></body>
</html>
@@ bar.mt
? my $args = shift;
<!doctype html>
<html>
<body><?= $args->{title} ?></body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment