Let's use Xslate Fuji, Goro (gfx) <gfuji@cpan.org>
Hello, Taiwan! <ul><li>I am: </li><ul><li>Fuji, Goro
a.k.a. gfx
a Perl hacker
from Shibuya.pm,  Japan ☢  </li></ul></ul>
What's Xslate? <ul><li>Xslate is a template engine for Perl5, developed at 2010
Available in Catalyst, Mojolicous </li></ul>
There're many template engines in CPAN <ul><li>Template::Toolkit
HTML::Template
Mason
Text::MicroTemplate
and so on...
But Xslate is the best </li></ul>
But good TE must be … <ul><li>Safe (tolerant to XSS)
Fast
Upcoming SlideShare
Loading in...5
×

Let's use Xslate - Osdc.tw 2011

1,466

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,466
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
6
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Let's use Xslate - Osdc.tw 2011

  1. 1. Let's use Xslate Fuji, Goro (gfx) <gfuji@cpan.org>
  2. 2. Hello, Taiwan! <ul><li>I am: </li><ul><li>Fuji, Goro
  3. 3. a.k.a. gfx
  4. 4. a Perl hacker
  5. 5. from Shibuya.pm, Japan ☢ </li></ul></ul>
  6. 6. What's Xslate? <ul><li>Xslate is a template engine for Perl5, developed at 2010
  7. 7. Available in Catalyst, Mojolicous </li></ul>
  8. 8. There're many template engines in CPAN <ul><li>Template::Toolkit
  9. 9. HTML::Template
  10. 10. Mason
  11. 11. Text::MicroTemplate
  12. 12. and so on...
  13. 13. But Xslate is the best </li></ul>
  14. 14. But good TE must be … <ul><li>Safe (tolerant to XSS)
  15. 15. Fast
  16. 16. Easy to use
  17. 17. Xslate is the best one in CPAN </li></ul>
  18. 18. Safe <ul><li>Automatic HTML escaping by default
  19. 19. de-adulting? No! fail-safe </li></ul>
  20. 20. Safe: Smart Escaping
  21. 21. Performance <ul><li>Slow softwares suck
  22. 22. 100 times faster than Template-Toolkit 2! </li></ul>
  23. 23. $ perl benchmark/x-rich-env.pl
  24. 24. Easiness to use <ul><li>Perl6-like syntax
  25. 25. TT2-like syntax
  26. 26. Readable error messages
  27. 27. Please give a try :) </li></ul>
  28. 28. Install $ curl -L cpanmin.us | perl – Text::Xslate or $ cpanm Text::Xslate
  29. 29. Command Line Interface $ xslate -Dlang='<Xslate>' -e 'Hello, <: $lang :> world!' Hello, &lt;Xslate&gt; world! $ xslate -e '<: my $add = -> $x, $y { $x + $y }; $add(40, 2) :>' 42
  30. 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', });
  31. 31. See also http://xslate.org/ and/or perldoc Text::Xslate
  32. 32. 終了 謝謝
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×