Skip to content

Instantly share code, notes, and snippets.

@kazeburo
Created November 26, 2010 06:57
Show Gist options
  • Save kazeburo/716366 to your computer and use it in GitHub Desktop.
Save kazeburo/716366 to your computer and use it in GitHub Desktop.
use warnings;
use Text::Xslate;
my $tx = Text::Xslate->new(
syntax => 'TTerse',
function => {
'sprintf' => sub {
my $format = shift;
sprintf($format,@_);
},
}
);
my $ret = $tx->render_string(<<'EOF');
[% sprintf("%010d",100) %]
EOF
print $ret;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment