Más contenido relacionado
Similar a Let's use Xslate - Osdc.tw 2011 (20)
Let's use Xslate - Osdc.tw 2011
- 28. Install $ curl -L cpanmin.us | perl – Text::Xslate or $ cpanm Text::Xslate
- 29. Command Line Interface $ xslate -Dlang='<Xslate>' -e 'Hello, <: $lang :> world!' Hello, <Xslate> world! $ xslate -e '<: my $add = -> $x, $y { $x + $y }; $add(40, 2) :>' 42
- 30. Try Xslate! #!perl -w use strict; use Text::Xslate; my $tx = Text::Xslate->new(); my $template = <<'TEMPLATE'; Hello, <: $lang :> world! TEMPLATE print $tx->render_string($template, { lang => 'Xslate', });