#!psgi -w use strict; use Text::Xslate; use Plack::Request; my %vpath = ( 'hello.tx' => <<'TX',
Hello, <: $lang :> world!
TX ); my $tx = Text::Xslate->new( path => \%vpath, cache_dir => '.eg_cache', ); sub app { my($env) = @_; my $req = Plack::Request->new($env); my $res = $req->new_response( 200, [content_type => 'text/html; charset=utf-8'], ); my %vars = ( lang => $req->param('lang') || '