Your SlideShare is downloading. ×
0
Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011
Let's use Xslate - Osdc.tw 2011
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Let's use Xslate - Osdc.tw 2011

1,455

Published on

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

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

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

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

×