Skip to content

Instantly share code, notes, and snippets.

@ktat
Created August 28, 2012 16:10
Show Gist options
  • Select an option

  • Save ktat/3499604 to your computer and use it in GitHub Desktop.

Select an option

Save ktat/3499604 to your computer and use it in GitHub Desktop.
Text::Xslateの謎な挙動
#!/usr/bin/perl
use strict;
use warnings;
use Text::Xslate;
use utf8;
use Encode;
my %vpath;
$vpath{"test.tt"} = <<_TMPL_;
[%- MACRO hoge1 (aaa) BLOCK -%]
[%- END -%]
[%- variable = 1 -%]
[%- MACRO hoge2 (bbb) BLOCK -%]
これが呼ばれないと再現しない
[%- END -%]
[%- hoge2(1) -%]
[% hoge1("AAA") %]
[% variable %] <- why "AAA" ???
_TMPL_
my $t = Text::Xslate->new(
syntax => 'TTerse',
cache_dir => '/tmp/xslate-cache/',
path => \%vpath
);
print Encode::encode("utf-8", $t->render("test.tt"));
@gfx

gfx commented Oct 14, 2012

Copy link
Copy Markdown

遅くなりましたが 1.5020 で修正しました!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment