Skip to content

Instantly share code, notes, and snippets.

@tomill
Created February 9, 2011 02:47
Show Gist options
  • Save tomill/817793 to your computer and use it in GitHub Desktop.
Save tomill/817793 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Test::More;
use Text::Xslate;
my $tx = Text::Xslate->new(
syntax => 'TTerse',
function => {
return_array => sub { my @array = ('A'..'Z') },
},
);
my $r = $tx->render_string(<<'...');
[% FOR item IN [ return_array() ]; item; END -%]
...
is($r, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "list context");
done_testing();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment