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

Let's use Xslate - Osdc.tw 2011

on

  • 1,618 views

 

Statistics

Views

Total Views
1,618
Views on SlideShare
1,449
Embed Views
169

Actions

Likes
2
Downloads
5
Comments
0

3 Embeds 169

http://d.hatena.ne.jp 167
https://twitter.com 1
http://orhowilearnedtolovetheperl.com 1

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Let's use Xslate - Osdc.tw 2011 Let's use Xslate - Osdc.tw 2011 Presentation Transcript

  • Let's use Xslate Fuji, Goro (gfx) <gfuji@cpan.org>
  • Hello, Taiwan!
    • I am:
      • Fuji, Goro
      • a.k.a. gfx
      • a Perl hacker
      • from Shibuya.pm, Japan ☢
  • What's Xslate?
    • Xslate is a template engine for Perl5, developed at 2010
    • Available in Catalyst, Mojolicous
  • There're many template engines in CPAN
    • Template::Toolkit
    • HTML::Template
    • Mason
    • Text::MicroTemplate
    • and so on...
    • But Xslate is the best
  • But good TE must be …
    • Safe (tolerant to XSS)
    • Fast
    • Easy to use
    • Xslate is the best one in CPAN
  • Safe
    • Automatic HTML escaping by default
    • de-adulting? No! fail-safe
  • Safe: Smart Escaping
  • Performance
    • Slow softwares suck
    • 100 times faster than Template-Toolkit 2!
  • $ perl benchmark/x-rich-env.pl
  • Easiness to use
    • Perl6-like syntax
    • TT2-like syntax
    • Readable error messages
    • Please give a try :)
  • Install $ curl -L cpanmin.us | perl – Text::Xslate or $ cpanm Text::Xslate
  • 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
  • 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', });
  • See also http://xslate.org/ and/or perldoc Text::Xslate
  • 終了 謝謝