Created
August 28, 2012 16:10
-
-
Save ktat/3499604 to your computer and use it in GitHub Desktop.
Text::Xslateの謎な挙動
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
遅くなりましたが 1.5020 で修正しました!