let's use xslate - osdc.tw 2011

Download Let's use Xslate - Osdc.tw 2011

If you can't read please download the document

Upload: goro-fuji

Post on 24-May-2015

1.452 views

Category:

Technology


1 download

TRANSCRIPT

  • 1. Let's use Xslate Fuji, Goro (gfx)

2. Hello, Taiwan!

  • I am:
  • Fuji, Goro

3. a.k.a. gfx 4. a Perl hacker 5. from Shibuya.pm,Japan 6. What's Xslate?

  • Xslate is a template engine for Perl5, developed at 2010

7. Available in Catalyst, Mojolicous 8. There're many template engines in CPAN

  • Template::Toolkit

9. HTML::Template 10. Mason 11. Text::MicroTemplate 12. and so on... 13. But Xslate is the best 14. But good TE must be

  • Safe (tolerant to XSS)

15. Fast 16. Easy to use 17. Xslate is the best one in CPAN 18. Safe

  • Automatic HTML escaping by default

19. de-adulting? No!fail-safe 20. Safe: Smart Escaping 21. Performance

  • Slow softwares suck

22. 100 times fasterthan Template-Toolkit 2! 23. $ perl benchmark/x-rich-env.pl 24. Easinessto use

  • Perl6-like syntax

25. TT2-like syntax 26. Readable error messages 27. Please give a try :) 28. Install $ curl -L cpanmin.us | perl Text::Xslate or $ cpanm Text::Xslate 29. Command Line Interface $ xslate -Dlang='' -e 'Hello, world!' Hello, world! $ xslate -e ' $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 = 'Xslate', }); 31. See also http://xslate.org/ and/or perldoc Text::Xslate 32.