Perl mp2 翻訳 テンプレートシステムの選択 (d225)

セラ (perlackline)

2022年08月15日 22:23

目次 - Perl Index


Theme



Perl について、復習を兼ねて断片的な情報を掲載して行く連載その d225 回。

今回は、mod_perl 「 Documentation / Tutorials / Part II: Templating / Choosing a Templating System 」を翻訳して確認します。

正確な内容は 原文 を確認してください。誤解や誤訳がある場合はご指摘ください。



説明 : Description



Everything you wanted to know about templating systems and didn't dare to ask. Well, not everything....

テンプレートシステムについてあなたが知りたいと思っていてあえて聞かなかったことのすべてです. まあ, すべてではありませんけど....


イントロダクション :Introduction



Go on, admit it: you've written a templating system. It's okay, nearly everyone has at some point. You start out with something beautifully simple like $HTML =~ s/$(\w+)/${$1}/g and end up adding conditionals and loops and includes until you've created your very own unmaintainable monster.

まずは, 認めましょう: あなたはテンプレートシステムを書きました. それは OK です, 誰もがそれをもったことがあります. あなたは $HTML =~ s/$(\w+)/${$1}/g のような美しくシンプルなものからはじめてあなたがあなた独自のメンテナンス不可能なモンスターを生み出すまで条件とループの追加をインクルードするのです.
Luckily for you, you are not the first to think it might be nice to get the HTML out of your code. Many have come before, and more than a few have put their contributions up on CPAN. At this time, there are so many templating modules on CPAN that it's almost certain you can find one that meets your needs. This document aims to be your guide to those modules, leading you down the path to the templating system of your dreams.

あなたにとって幸運なことに, あなたのコードから HTML を取り出すことがナイスだと考えることはあなたが最初ではありません. これまでも多くの人が来ていて, 少なくない人たちが CPAN にそのコントリビュートをしています. 現時点では, CPAN 上に多くのテンプレーティングモジュールがあるのであなたのニーズにあったものをあなたが見つけれられることはほとんど確実です. このドキュメントはあなたのためのそれらのモジュールのガイドになってあなたをあなたが夢見るテンプレートシステムに導くことを目的としています.
And, if you just went straight to CPAN in the first place and never bothered to write your own, congratulations: you're one step ahead of the rest of us.

そして, もしあなたが最初に CPAN に直行してあなた自身で書くことにこだわらないなら, おめでとう: あなたは他の人々よりも 1 歩進んでいます.


個人的なこと : On A Personal Note



Nothing can start an argument faster on the mod_perl mailing list than a claim that one approach to templating is better than another. People get very attached to the tools they've chosen. Therefore, let me say up front that I am biased. I've been at this for a while and I have opinions about what works best. I've tried to present a balanced appraisal of the features of various systems in this document, but it probably won't take you long to figure out what I like. Besides, attempts to be completely unbiased lead to useless documents that don't contain any real information. So take it all with a pound of salt and if you think I've been unfair to a particular tool through a factual error or omission, let me know.

mod_perl のメーリングリストでテンプレーティングへのあるアプローチが他よりもベターだという主張よりも速く議論を始められるものはありません. 人は自分が選択したツールにとても愛情を感じます. ですから, まずは私に私は偏っていると言わせてください. 私はしばらくこれに関わって私は何がベストに機能するかについて意見をもっています. 私はこのドキュメントで様々なシステムの機能のバランスされた評価を提示することにトライしましたが, おそらくあなたは私が何を好んでいるかを見つけだすのに長くはかからないはずです. なお, 完全に偏見のない試みはリアルな情報を含むことのない無益なドキュメントに繋がります. ですから全体の塩梅をみてもし私が事実の誤認や漏れを通じて特定のツールにアンフェアだとあなたが思ったら, 私に知らせてください.


なぜテンプレートを使う ? : Why Use Templates?



Why bother using templates at all? Print statements and CGI.pm were good enough for Grandpa, so why should you bother learning a new way to do things?

いったいなぜテンプレートをわざわざ使うのでしょうか ? Print 文と CGI.pm は祖父にとっては十分だったのですから, なぜあなたは物事を行うための新しい方法をわざわざ学ばなければならないのでしょうか ?


外観の一貫性 : Consistency of Appearance



It doesn't take a genius to see that making one navigation bar template and using it in all of your pages is easier to manage than hard-coding it every where. If you build your whole site like this, it's much easier to make site-wide changes in the look and feel.

ひとつのナビゲータバーのテンプレートを作ってそれをあなたのページの全てで使うのがすべての場所でハードコーディングするよりも管理が簡単であることを理解するために天才である必要はありません. もしあなたがあなたのサイト全体をこのようにビルドするなら, サイト全体のルックアンドフィールの変更がはるかに簡単になります.


再利用性 : Reusability



Along the same lines, building a set of commonly used components makes it easier to create new pages.

同じ方針で, よく使われるコンポーネントのセットをビルドすれば新しいページの作成を簡単にできます.


変更からのベターな分離 : Better Isolation from Changes



Which one changes more often, the logic of your application or the HTML used to display it? It actually doesn't matter which you answered, as long as it's one of them. Templates can be a great abstraction layer between the application logic and the display logic, allowing one to be updated without touching the other.

あなたのアプリケーションのロジックとその表示に使われる HTML, どちらがより頻繁に変更されるものですか ? 実際はそのうちのひとつであれば, あなたの答えは重要ではありません. テンプレートはアプリケーションロジックとディスプレイロジックの間のグレートな抽象化レイヤになり, 他方に触れることなく一方をアップデートさせることを可能にします.


分業 : Division of Labor



Separating your Perl code from your HTML means that when your marketing department decides everything should be green instead of blue, you don't have to lift a finger. Just send them to the HTML coder down the hall. It's a beautiful thing, getting out of the HTML business.

あなたの HTML からあなたの Perl コードを分離することはあなたのマーケティング部門がすべてを青のかわりに緑にすると判断したときに, あなたは何もする必要がないことを意味します. 単にそれらを廊下の先の HTML コーダーに送るだけです. HTML の業務から抜けだすのは, ビューティフルなことです.
Even if the same people in your organization write the Perl code and the HTML, you at last have the opportunity for more people to be working on the project in parallel.

あなたの組織で Perl コードと HTML を同じ人が書いているのだとしたら, あなたは多くの人が並行するプロジェクトに取り組む機会をようやく持つことができます.


違いは何か ? : What Are the Differences?



Before we look at the available options, let's go through an explanation of some of the things that make them different.

私たちが利用可能なオプションを確認する前に, それらを違うものにするいくつかの物事の説明を通り抜けましょう.


実行モデル : Execution Models



Although some try to be flexible about it, most templating systems expect you to use some variation of the two basic execution models, which I will refer to as "pipeline" and "callback." In the callback style, you let the template take over and it has the application's control flow coded into it. It uses callbacks to modules or snippets of in-line Perl code to retrieve data for display or perform actions like user authentication. Some popular examples of systems using this model include Mason, Embperl, and Apache::ASP.

いくつかそれをフレキシブルにする試みもありますが, ほとんどのテンプレーティングシステムはあなたが 2 つのベーシックな実行モデルのいくつかのバリエーションを使うことを使うことを期待していて, それを私は "パイプライン" (# pipeline) と "コールバック" (# callback) とよびます. callback システムでは, あなたはそのテンプレートがその内部にコード化されたアプリケーションのコントロールフローを持つことを任せます. それは表示やユーザ認証のようなアクションを実行するためにモジュールやインラインの Perl コードのスニペットへのコールバックを使います. このモデルを使ういくつかのポピュラーな例は Mason, Embperl, それから Apache::ASP を含みます.
The pipeline style does all the work up front in a standard CGI or mod_perl handler, then decides which template to run and passes some data to it. The template has no control flow logic in it, just presentation logic, e.g. show this graphic if this item is on sale. Popular systems supporting this approach include HTML::Template and Template Toolkit.

pipeline スタイルはスタンダードな CGI や mod_perl ハンドラですべての作業を事前に行い, それからどのテンプレートを実行するかを決定してそれにいくつかのデータを渡します. そのテンプレートはその内部にコントロールフローのロジックをもっていません, プレゼンテーションロジックだけです, e.g. このアイテムが販売中ならこのグラフィックを表示する. このアプローチをサポートするポピュラーなシステムは HTML::Template や Template Toolkit を含みます.
The callback model works very well for publishing-oriented sites where the pages are essentially mix and match sets of articles and lists. Ideally, a site can be broken down into visual "components" or pieces of pages which are general enough for an HTML coder to re-combine them into entirely new kinds of pages without any help from a programmer.

callback モデルはページが基本的に記事とリストのセットをさまざまに組み合わせるパブリッシング指向のサイトでとてもよく機能します. 理想的なのは, サイトをビジュアル "コンポーネント" やページの一部に分割してそれがプログラマのヘルプなしに HTML コーダーが完全に新しい種類のページにそれらを再結合できるくらいに一般的であることです.
The callback model can get a bit hairy when you have to code logic that can result in totally different content being returned. For example, if you have a system that processes some form input and takes the user to different pages depending on the data submitted. In these situations, it's easy to end up coding a spaghetti of includes and redirects, or putting what are really multiple pages in the same file.

callback モデルはあなたがまったく異なるコンテンツがリターンされるかもしれないロジックをコーディングしなければならないときにすこし難しくなることがあります. 例えば, あなたが何らかのフォーム入力を処理してそのユーザが送信されたデータに応じて違うページに行くシステムをもっているとします. こうした状況では, インクルードやリダイレクトのスパゲッティコーディングや, 本当は複数のページを同じファイルにおいてしまうことをしがちです.
On the other hand, a callback approach can result in fewer files (if the Perl code is in the HTML file), and feels easier and more intuitive to many developers. It's a simple step from static files to static files with a few in-line snippets of code in them. This is part of why PHP is so popular with new developers.

一方で, callback アプローチはより少ないファイル (Perl コードが HTML ファイル内にある場合) につながり, 多くの開発者に簡単にはより直感的に感じれられます. それは静的ファイルからそれらにいくつかコードのインラインインラインスニペットを伴う静的ファイルへのシンプルなステップです. これは PHP が新しい開発者にポピュラーな理由の一部です.
The pipeline model is more like a traditional model-view-controller design. Working this way can provide additional performance tuning opportunities over an approach where you don't know what data will be needed at the beginning of the request. You can aggregate database queries, make smarter choices about caching, etc. It can also promote a cleaner separation of application logic and presentation. However, this approach takes longer to get started with since it's a bigger conceptual hurdle and always involves at least two files: one for the Perl code and one for the template.

pipeline モデルはトラディショナルな model-view-controller 設計により似ています. このやり方で作業をすることはリクエストの開始時で何のデータが必要とされるかをあなたが知らないアプローチよりも追加のパフォーマンスチューニングの機会を提供できます. あなたはデータベースクエリを集約したり, キャッシングについてよりスマートな選択をする, etc ができます. それはまたアプリケーションロジックとプレゼンテーションのより明確な分離を促進できます. しかしながら, このアプローチはそのコンセプトのハードルがより大きくて常に少なくとも 2 つのファイルを要するため始めるまでに時間がかかります: 1 つは Perl コード用でもう 1 つはテンプレート用.
Keep in mind, many systems offer significant flexibility for customizing their execution models. For example, Mason users could write separate components for application logic and display, letting the logic components choose which display component to run after fetching their data. This allows it to be used in a pipeline style. A Template Toolkit application could be written to use a simple generic handler (like the Apache::Template module included in the distribution) with all the application logic placed in the template using object calls or in-line Perl. This would be using it in a callback style.

留意してください, 多くのシステムはその実行モデルをカスタマイズすために大きなフレキシビリティを提供しています. 例えば, Mason ユーザはアプリケーションロジックとディスプレイを分割して記述し, ロジックコンポーネントがそのデータをフェッチした後にどのディスプレイコンポートネントを実行するかを選択させることができます. これは pipeline スタイルで使えるようになります. Template Toolkit アプリケーションはオブジェクトコールやインライン Perl を使って全てのアプリケーションロジックをそのテンプレートに配置したシンプルな汎用ハンドラ (ディストリビューションに含まれる Apache::Template モジュールのような) を使うように書けます. これは callback スタイルで使うことになります.
HTML::Template is fairly rigid about insisting on a pipeline approach. It doesn't provide methods for calling back into Perl code during the HTML formatting stage; you have to do the work before running the template. The author of the module consider this a feature since it prevents developers from cheating on the separation of application code and presentation.

HTML::Template は pipeline アプローチについての主張がかなり頑なです. それは HTML フォーマット段階での Perl コードへの callback のメソッドを提供しません; あなたはテンプレートを実行する前に作業を行わなければなりません. このモジュールの作者はこれをアプリケーションコードとプレゼンテーションの分離で開発者がズルすることを防止するための機能だとみなしています.


言語 : Languages



Here's the big issue with templating systems. This is the one that always cranks up the flame on web development mailing lists.

こちらはテンプレートシステムでの大きな課題です. これは web 開発者のメーリングリストを常に炎上させるものです.
Some systems use in-line Perl statements. They may provide some extra semantics, like Embperl's operators for specifying whether the code's output should be displayed or Mason's <%init> sections for specifying when the code gets run, but at the end of the day your templates are written in Perl.

いくつかのシステムはインラインの Perl ステートメントを使います. それらはコードの出力を表示すべきかどうかを指定する Embperl のオペレータやいつコードを実行するかを指定する Mason の <%init> セクションのような, いくつか追加のセマンティクスを提供したりしますが, 結局のところあなたのテンプレートは Perl で書かれています.
Other systems provide a specialized mini-language instead of (or in addition to) in-line Perl. These will typically have just enough syntax to handle variable substitution, conditionals, and looping. HTML::Template and Template Toolkit are popular systems using this approach.

他のシステムはインライン Perl の代わりに (あるいは追加で) 特殊なミニ言語を提供します. 通常それらは変数の置換, 条件, およびループを処理するのに十分なシンタクスだけをもっています. HTML::Template や Template Toolkit はこのアプローチを使うポピュラーなシステムです.
Here's how a typical discussion of the merits of these approaches might go:

こちらはこれらのアプローチのメリットがどのようにディスカッションされるかの典型例です:
IN-LINE: Mini-languages are stupid. I already know Perl and it's easy enough. Why would you want to use something different?

IN-LINE: ミニ言語はアホだ. 僕はすでに Perl を知ってるしそれは十分に簡単だ. なんであんたはわざわざ違うものを使おうとするんだ ?
MINI-LANG: Because my HTML coder doesn't know Perl, and this is easier for him.

MINI-LANG: 僕の HTML コーダーは Perl を知らないし, 彼にとってこれは簡単だからだ.
IN-LINE: Maybe he should learn some Perl. He'd get paid more.

IN-LINE: たぶんそいつは Perl を学んだほうがいい. そいつはもっと多くの給料をもらえるよ.
MINI-LANG: Whatever. You just want to use in-line Perl so you can handle change requests by putting little hacks in the template instead of changing your modules. That's sloppy coding.

MINI-LANG: どうだっていいよ. あんたは自分のモジュールを変更するのが面倒だからテンプレートを少しハックするだけで変更に対応できるインライン Perl を使いたいだけじゃないか. それをずさんなコーディングという.
IN-LINE: That's efficient coding. I can knock out data editing screens in half the time it takes you, and then I can go back through, putting all the in-line code into modules and just have the templates call them.

IN-LINE: それは効率的という. 僕はあんたの半分の時間で, データ編集の画面をノックアウトして戻り, モジュールにインラインコードを追加しそれをテンプレートでコールするだけだ.
MINI-LANG: You could, but you won't.

MINI-LANG: それはできるかもしれない, だがあんたはやらないだろ.
IN-LINE: Is it chilly up there in that ivory tower?

IN-LINE: 象牙の塔は寒いだろ ?
MINI-LANG: Go write some VBScript, weenie.

MINI-LANG: VBScript でも書いてろ, おxんぽ野郎.
etc.
Most people pick a side in this war and stay there. If you are one of the few who hasn't fully decided yet, you should take a moment to think about who will be building and maintaining your templates, what skills those people have, and what will allow them to work most efficiently.

ほとんどの人はこの争いのどちらか側についてそこにとどまります. もしあなたがまだ完全に決断していない数少ない人のひとりなら, あなたはあなたのテンプレートを誰が構築してメンテナンスしているのか, それらの人たちがどのようなスキルをもっているのか, そして何が彼らを最も効率的に作業させるのかについて少し考えてみるべきです.
Here's an example of a simple chunk of template using first an in-line style (Apache::ASP in this case) and then a mini-language style (Template Toolkit). This code fetches an object and displays some properties of it. The data structures used are identical in both examples. First Apache::ASP:

こちらは最初にインラインスタイル (このケースでは Apache::ASP) それからミニ言語スタイル (Template Toolkit) を使ったテンプレートのシンプルなチャンク (# 塊り) の例です. このコードはオブジェクトをフェッチしてそのプロパティの一部を表示します. 使われるデータ構造は両方の例で同一です. まずは Apache::ASP (# インラインスタイル) です:

<% my $product = Product->load('sku' => 'bar1234'); %>

<% if ($product->isdn) { %>
It's a book!
<% } else { %>
It's NOT a book!
<% } %>

<% forearch my $item (@{$product->related}) { %>
You might also enjoy <% $item->name %>.
<% } %>

And now Template Toolkit:

そして Template Toolkit (# ミニ言語):

[% USE product(sku=bar1234) %]

[% IF product.isbn %]
It's a book!
[% ELSE %]
It's NOT a book!
[% END %]

[% FOREACH item = product.related %]
You might also enjoy [% item.name %]
[% END %]

There is a third approach, based on parsing an HTML document into a DOM tree and then manipulating the contents of the nodes. The only module using this approach is HTML_Tree. The idea is similar to using a mini-language, but it doesn't require any non-standard HTML tags and it doesn't embed any logic about loops or conditionals in the template itself. This is nice because it means your templates are valid HTML documents that can be viewed in a browser and worked with in most standard HTML tools. It also means people working with the templates can put placeholder data in them for testing and it will simply be replaced when the template is used. This preview ability only breaks down when you need an if/else type construct in the template. In that situation, both the "if" and "else" chunks of HTML would show up when previewing.

3 番目のアプローチがあります, HTML ドキュメントをパースした DOM ツリーに基づいてそのノードのコンテンツを操作します. このアプローチを使用する唯一のモジュールが HTML_Tree です. このアイデアはミニ言語を使うことと似ていますが, 非標準の HTML タグを必要とせずテンプレート自身にループや条件に関するロジックを埋め込みません. これはあなたのテンプレートがブラウザで見れてほとんどの標準的な HTML ツールで機能できる有効な HTML ドキュメントであることを意味するのでこれはナイスです. それはまたテンプレートで作業する人たちがその中にテスト用のプレースホルダデータを置くことができてそのテンプレートが使われたときにシンプルにリプレイスできることを意味します. このプレビュー能力はあなたがテンプレート内で if/else 構成を必要とするときのみ壊れます. そのシチュエーションでは, プレビュー時に HTML の "if" と "else" のチャンク両方が表示されます.


パーサとキャッシュ : Parsers and Caching



The parsers for these templating systems are implemented in one of three ways: they parse the template every time ("repeated parse"), they parse it and cache the resulting parse tree ("cached parse tree"), or they parse it, convert it to Perl code, and compile it ("compiled").

これらのテンプレートシステムのためのパーサは 3 つの方法のどれかで実装されます: それはテンプレートを毎回パースする ("repeated parse"), それはパースしてその結果のパースツリーをキャッシュする ("cached parse tree"), あるいはそれはパースして, それを Perl コードに変換して, それをコンパイルする ("compiled").
Systems that compile templates to Perl take advantage of Perl's powerful runtime code evaluation capabilities. They examine the template, generate a chunk of Perl code from it, and eval the generated code. After that, subsequent requests for the template can be handled by running the compiled bytecode in memory. The complexity of the parsing and code generation steps varies based on the number of bells and whistles the system provides beyond straight in-line Perl statements.

テンプレートを Perl にコンパイルするシステムは Perl のパワフルなランタイムコードの評価能力を活用します. それらはテンプレートを検査して, そこから Perl コードのチャンクを生成し, その生成されたコードを eval します. その後, メモリ内でコンパイルされたバイトコードを実行することでそのテンプレートへの後続のリクエストを処理できます. パースとコード生成ステップの複雑さはそのシステムがストレートなインライン Perl ステートメントを超えて提供するベルとホイッスル (# 他の機能) の数によって違います.
Compiling to Perl and then to Perl bytecode is slow on the first hit but provides excellent performance once the template has been compiled, since the template becomes a Perl subroutine call. This is the same approach used by systems like JSP (Java ServerPages). It is most effective in environments with a long-running Perl interpreter, like mod_perl.

Perl それから Perl バイトコードへのコンパイルは最初のヒットでは遅いですが一度テンプレートがコンパイルされるとエクセレントなパフォーマンスを提供します, そのテンプレートが Perl のサブルーチンコールになるからです. これは JSP (Java ServerPages) 的なシステムによって使われるアプローチと同じです. それは mod_perl のように, 長時間走る環境で最も効果的です.
HTML::Template, HTML_Tree, and the 2.0 beta release of Embperl all use a cached parse tree approach. They parse templates into their respective internal data structures and then keep the parsed structure for each processed template in memory. This is similar to the compiled Perl approach in terms of performance and memory requirements, but does not actually involve Perl code generation and thus doesn't require an eval step. Which way is faster, caching the parse tree or compiling? It's hard to objectively measure, but anecdotal evidence seems to support compilation. Template Toolkit used a cached parse tree approach for version 1, but switched to a compilation approach for version 2 after tests showed it to offer a significant speed increase. However, as will be discussed later, either approach is more than fast enough.

HTML::Template, HTML_Tree, それから Embperl の 2.0 ベータリリースはすべてキャッシュされたパースツリーアプローチを使います. それらはテンプレートをそのそれぞれの内部データ構造にパースしてメモリ内に処理されたテンプレートごとのパース済みの構造をキープします. これはパフォーマンスとメモリ要求の観点ではコンパイルされた Perl のアプローチと似ていますが, 実際には Perl コードの生成を伴わないため eval ステップは必要としません. パースツリーのキャッシュとコンパイル, どちらが高速でしょうか ? 客観的な測定はハードですが, 事例証拠 (# 経験則的に) はコンパイルを指示しているようにみえます. Template Toolkit はバージョン 1 でキャッシュされたパースアプローチを使っていましたが, 大幅なスピード向上の提供が示されたテストの後バージョン 2 でコンパイルアプローチにスイッチしました. しかしながら, 後で論じるように, どちらのアプローチも十分に高速です.
In contrast to this, a repeated parse approach may sound very slow. However, it can be pretty fast if the tokens being parsed for are simple enough. Systems using this approach generally use very simple tokens, which allows them to use fast and simple parsers.

これとは対照的に, 繰り返されるパースアプローチはとても遅く聞こえるかもしれません. しかしながら, もしパースされるトークンが十分にシンプルならそれはかなり高速になれるかもしれません. このアプローチを使うシステムは通常とてもシンプルなトークンを使い, これはそれらが高速でシンプルなパーサを使うことを可能にします.
Why would you ever use a system with this approach if compilation has better performance? Well, in an environment without a persistent Perl interpreter like vanilla CGI this can actually be faster than a compiled approach since the startup cost is lower. The caching of Perl bytecode done by compilation systems is useless when the Perl interpreter doesn't stick around for more than one request.

なぜコンパイルがベターなパフォーマンスをもっているのにあなたはこのアプローチ (# パースアプローチ) でシステムを使うことになるのでしょうか ? そうですね, vanilla CGI のような永続的な Perl インタプリタがない環境でこれはそのスタートアップのコストが低いので実際にはコンパイルアプローチよりもより高速になりえます. コンパイルシステムによって行われる Perl バイトコードのキャッシングは Perl インタプリタが 1 つ以上のリクエストを待たないときは役に立たないのです.
There are other reasons too. Compiled Perl code takes up a lot of memory. If you have many unique templates, they can add up fast. Imagine how much RAM it would take up if every page that used server-side includes (SSI) had to stay in memory after it had been accessed. (Don't worry, the Apache::SSI module doesn't use compilation so it doesn't have this problem.)

他の理由もあります. コンパイルされた Perl コードは多くのメモリを取ります. もしあなたがユニークなテンプレートをたくさんもっている場合, それはすぐに増加するでしょう. server-side-includes (SSI) を使うすべてのページがアクセスされた後でメモリに留まるとした場合にそれがどのくらいの RAM を取るか想像してください. (ご心配なく, Apache::SSI モジュールはコンパイルを使わないのでこの問題をもっていません.)


アプリケーションフレームワーク vs. 単なるテンプレート : Application Frameworks vs. Just Templates



Some of the templating tools try to offer a comprehensive solution to the problems of web development. Others offer just a templating solution and assume you will fit this together with other modules to build a complete system.

いくつかのテンプレートツールは web 開発の問題への包括的なソリューションの提供をトライします (# フレームワーク). 他は単にテンプレートのソリューションを提供してあなたが完全なシステムをビルドするために他のモジュールと組み合わせることを想定します.
Some common features offered in the frameworks include:

フレームワークで提供されるいくつか一般的な機能はこれを含みます:


URL マッピング : URL Mapping



All of the frameworks offer a way to map a URL to a template file. In addition to simple mappings similar to the handling of static documents, some offer ways to intercept all requests within a certain directory for pre-processing, or create an object inheritance scheme out of the directory structure of a site.

すべてのフレームワークはテンプレートファイルに URL をマップする方法を提供します. 静的ドキュメントのハンドリングと似たシンプルなマッピングに加えて, 前処理のために特定のディレクトリ内のすべてのリクエストをインターセプトしたり, サイトのディレクトリ構造からオブジェクト継承スキームを作成する方法を提供するものもあります.


セッショントラッキング : Session Tracking



Most interactive sites need to use some kind of session tracking to associate application state data with a user. Some tools make this very easy by handling all the cookies or URL-munging for you and letting you simply read and write from an object or hash that contains the current user's session data. A common approach is to use the Apache::Session module for storage.

ほとんどのインタラクティブサイトはユーザとアプリケーションの状態を関連付けるためにある種のセッショントラッキングを使う必要があります. いくつかのツールはあなたのためにすべてのクッキーや URL 変換を処理して現在のユーザのセッションデータを含むオブジェクトやハッシュからあなたがシンプルに読み書きできるようにすることでこれをとても簡単にします. 一般的なアプローチはストレージ用に Apache::Session モジュールを使うことです.


出力のキャッシュ : Output Caching



While caching of output is outside the scope of most templating systems, Mason includes it as a standard feature. In addition to page-level caching, Mason also offers fine-grained caching of output from sections within a page.

アウトプットのキャッシングはほとんどのテンプレートの範囲外ですが, Mason はそれを標準機能として含んでいます. ページレベルのキャッシングに加えて Mason はページ内のセクションからの出力のきめ細かいキャッシングも提供します.


フォームのハンドリング : Form Handling



How will you live without CGI.pm to parse incoming form data? Many of these tools will do it for you, making it available in a convenient data structure. Some also validate form input, and even provide "sticky" form widgets that keep their selected values when re-displayed or set up default values based on data you provide.

あなたはインカミングのデータをパースするために CGI.pm なしでどのようにすごしますか ? これらのツールの多くはあなたのためにこれを行って, 便利なデータ構造でそれを利用できるようにします. またフォームインプットのバリデート (# 検査) をしたり, 再表示されたときにセレクトされていた値をキープする "sticy" なフォームウィジェットやあなたが提供するデータに基づいてデフォルト値をセットアップすることさえ提供するものもあります.


デバッギング : Debugging



Everyone knows how painful it can be to debug a CGI script. Templating systems can make it worse, by screwing up Perl's line numbers with generated code. To help fix the problem they've created, some offer built-in debugging support, including extra logging, or integration with the Perl debugger.

CGI スクリプトをデバッグすることがどれだけ辛いかを誰もが知っています. テンプレーティングシステムは生成されたコードで Perl の行番号をめちゃくちゃにすることで, それをより悪くしえます. それらが生成する問題のフィックスをヘルプするために, 追加のロギングや, Perl デバッガとの統合を含む, ビルトインのデバッギングサポートを提供するものもあります.
If you want to use a system that just does templates but you need some of these other features and don't feel like implementing them yourself, there are some tools on CPAN which provide a framework you can build on. The libservlet distribution, which provides an interface similar to the Java servlet API, is independent of any particular templating system. Apache::PageKit and CGI::Application are other options in this vein, but both of these are currently tied to HTML::Template. OpenInteract is another framework, this time tied to Template Toolkit. All of these could be adapted for the "just templates" module of your choice with fairly minimal effort.

もしあなたがテンプレートを行うだけのシステムを使いたいがあなたがそうした他の機能を必要としかつそれをあなた自身で実装したくない場合は, あなたが基礎にできるフレームワークを提供するいくつかのツールが CPAN 上にあります. Java servlet API に似たインターフェイスを提供する, libservlet ディストリビューションは, 特定のテンプレーティングシステムから独立しています. この脈絡では Apache::PageKit と CGI::Application が他のオプションですが, それらは両方とも現在は HTML::Template に関連付けられています. OpenInteract はまた別のフレームワークで, 今度は Template Toolkit に関連付けられています. これらはすべてかなりわずかな労力であなたがチョイスした "単なるテンプレート" モジュールに適応させることができます.


候補 : The Contenders



Okay, now that you know something about what separates these tools from each other, let's take a look at the top choices for Perl templating systems. This is not an exhaustive list: I've only included systems that are currently maintained, well-documented, and have managed to build up a significant user community. In short, I've left out a dozen or so less popular systems. At the end of this section, I'll mention a few systems that aren't as commonly used but may be worth a look.

オーケー, あなたはこれらのツールを互いに分けるものについてを知ったので, Perl テンプレートシステムのトップチョイスを見てみましょう. これは網羅的なリストではありません: 私は現在メンテナンスされている, よくドキュメント化されている, そして意義深いユーザコミュニティを構築できたシステムだけを含めました. ようするに, 私は 1 ダース程度のあまり人気のないシステムを省きました. このセクションの最後で, 一般的には使われていないが一見の価値があるかもしれないいくつかのシステムに言及します.


SSI



SSI is the granddaddy of templating systems, and the first one that many people used since it comes as a standard part of most web servers. With mod_perl installed, mod_include gains some additional power. Specifically, it is able to take a new #perl directive (though only if mod_perl is statically built) which allows for in-line subroutine calls. It can also efficiently include the output of Apache::Registry scripts by using the Apache::Include module.

SSI (# Server Side Include) はテンプレーティングシステムの祖父で, ほとんどの web サーバの標準パートになっているので多くの人が最初に利用したものです. mod_perl がインストールされると, mod_include がさらなるパワーをゲインします. 特に, それはインラインのサブルーチンコールを可能にする新しい #perl ディレクティブ (しかし mod_perl が静的ビルドの場合のみ) をとれるようになります. それはまた Apache::Include モジュールを使うことで Apache::Registry のアウトプットを効果的に含めることもできるようにします.
The Apache::SSI module implements the functionality of mod_include entirely in Perl, including the additional #perl directive. The main reasons to use it are to post-process the output of another handler (with Apache::Filter) or to add your own directives. Adding directives is easy through subclassing. You might be tempted to implement a complete template processor in this way, by adding loops and other constructs, but it's probably not worth the trouble with so many other tools out there.

Apache::SSI モジュールは mod_include の機能を完全に実装し, 追加の #perl ディレクティブを含みます. これをつかう主な理由は (Apache::Filter で) 別のハンドラのアウトプットをポストプロセスしたりあなた独自のディレクティブを追加することです. ディレクティブの追加はサブクラス化をとおして簡単にできます. あなたはこの方法でループや他の構造を追加することで, 完全なテンプレートプロセッサを実装したくなるかもしれませんが, 他に多くのツールがあるのでおそらくそれをわざわざするだけの価値はありません.
SSI follows the callback model and is mostly a mini-language, although you can sneak in bits of Perl code as anonymous subs in #perl directives. Because SSI uses a repeated parse implementation, it is safe to use it on large numbers of files without worrying about memory bloat.

SSI は callback モデルをフォローしほとんどがミニ言語ですが, あなたは #perl ディレクティブで無名サブルーチンとして Perl コードのかけらを忍び込ませること (# スネーク) ができます. SSI は繰り返されるパース (# repeated parse) の実装を使うため, メモリの肥大化について心配することなくそれを多数のファイルで安全に使えます.
SSI is a great choice for sites with fairly simple templating needs, especially ones that just want to share some standard headers and footers between pages. However, you should consider whether or not your site will eventually need to grow into something with more flexibility and power before settling on this simple approach.

SSI はテンプレーティングの必要性がかなりシンプルなサイトではグレートなチョイスです, 特にページ間でいくつか標準のヘッダとフッタを共有したいだけのものです. しかしながら, このシンプルなアプローチに落ち着く前にあなたはあなたのサイトが最終的により柔軟で強力なものに成長する必要があるかどうかを考慮するべきです.


HTML::Mason



Mason has been around for a few years now, and has built up a loyal following. It was originally created as a Perl clone of some of the most interesting features from Vignette StoryServer, but has since become it's own unique animal. It comes from a publishing background, and includes features oriented towards splitting up pages into re-useable chunks, or "components."

Mason は数年前からあり, 忠実な支持者を築いています. それはもともと Vignette StoryServer からのいくつか最も興味深い機能の Perl クローンとして作成されましたが, 後にユニークな動物になりました. それは独自のパブリッシングのバックグラウンドから来ていて, ページを再利用できるチャンク, あるいは "コンポーネント" に分割を指向する機能を含んでいます.
Mason uses in-line Perl with a compilation approach, but has a feature to help keep the perl code out of the HTML coder's way. Components (templates) can include a section of Perl at the end of the file which is wrapped inside a special tag indicating that it should be run first, before the rest of the template. This allows programmers to put all the logic for a component down at the bottom away from the HTML, and then use short in-line Perl snippets in the HTML to insert values, loop through lists, etc.

Mason はコンパイルアプローチでのインライン Perl を使いますが, perl コードを HTML コーダの邪魔にならないようにすることをヘルプする機能をもっています. コンポーネント (テンプレート) はファイルの末尾 (# EOF) に Perl のセクションを含むことができてそれは他のテンプレートの前に, 最初に実行すべきことを示す特別なタグの内側にラップされます. これはプログラマにコンポーネントのすべてのロジックを HTML から離れた下の方に置けるようにして, 値の挿入, リストによるループ, etc のために HTML 内で短いインライン Perl スニペットを使えるようにします.
Mason is a site development framework, not just a templating tool. It includes a very handy caching feature that can be used for capturing the output of components or simply storing data that is expensive to compute. It is currently the only tool that offers this sort of caching as a built-in. It also implements an argument parsing scheme which allows a component to specify the names, types, and default values that it expects to be passed, either from another component or from the values passed in the URI query string.

Mason はサイト開発フレームワークで, 単なるテンプレーティングツールではありません. それはコンポーネントのアウトプットをキャプチャしたり計算が高価なデータをシンプルに格納するために使えるとても便利なキャッシュ機能を含みます. これは今のところ組み込みでこの種のキャッシングを提供する唯一のツールです. またこれは別のコンポーネントや URI クエリストリングで渡された値のいずれかから渡されることを期待する名前, タイプ, それからデフォルトの値をコンポーネントが指定できるように引数をパースするスキームを実装しています.
While the documentation mostly demonstrates a callback execution model, it is possible to use Mason in a pipeline style. This can be accomplished in various ways, including designating components as "autohandlers" which run before anything else for requests within a certain directory structure. An autohandler could do some processing and set up data for a display template which only includes minimal in-line Perl. There is also support for an object-oriented site approach, applying concepts like inheritance to the site directory structure. For example, the component at /store/book/ might inherit a standard layout from the component at /store/, but override the background color and navigation bar. Then /store/music/ can do the same, with a different color. This can be a very powerful paradigm for developing large sites.

ドキュメントは概ね callback 実行モデルを示していますが, pipeline スタイルで Mason を使うことも可能です. これは特定のディレクトリ構造内でのリクエストに他の何よりも前に実行する "autohandlers" としてコンポーネントを指定することを含む, さまざまな方法で実現できます. autohandler は最小限のインライン Perl だけを含むディスプレイテンプレートのためにいくつかの処理とデータのセットアップを行えます. サイトのディレクトリ構造に継承のようなコンセプトを適用するオブジェクト指向のサイトアプローチのためのサポートもあります. 例えば, /store/book/ のコンポーネントは /store/ からの標準レイアウトを継承しつつ, 背景色とナビゲーションバーをオーバライドできます. /store/music/ でも異なる色で, 同じことができます. これは大規模サイトの開発でとてもパワフルなパラダイムになりえます.
Mason's approach to debugging is to create "debug files" which run Mason outside of a web server environment, providing a fake web request and activating the debugger. This can be helpful if you're having trouble getting Apache::DB to behave under mod_perl, or using an execution environment that doesn't provide built-in debugger support.

デバッギングのための Mason のアプローチは web サーバ環境の外部で Mason を実行する "デバッグファイル" を作成して, フェイクの web リクエストを提供してデバッガをアクティブ化するものです. あなたが mod_perl のもとでの Apache::DB の振る舞いでトラブルをもっていたり, ビルトインのデバッガをサポートしない実行環境を使っている場合に役立つはずです.
Another unique feature is the ability to leave the static text parts of a large template on disk, and pull them in with a file seek when needed rather than keeping them in RAM. This exchanges some speed for a significant savings in memory when dealing with templates that are mostly static text.

また別のユニークな機能はディスク上の大きなテンプレートの静的なテキストパートを RAM で維持するのではなくそのままにしておいて必要なときにそれらをファイルシークで取り出す能力です. これはほとんどが静的テキストのテンプレートを処理するときにメモリの大幅な節約とある程度の速度を交換します.
There are many other features in this package, including filtering of HTML output and a page previewing utility. Session support is not built-in, but a simple example showing how to integrate with Apache::Session is included. Mason's feature set can be a bit overwhelming for newbies, but the high-quality documentation and helpful user community go a long way.

このパッケージには HTML アウトプットのフィルタリングやページプレビューのユーティリティを含む, たくさんの他の機能があります. セッションサポートは組み込まれていませんが, Apache::Session とどのようにして統合するかを示すシンプルな例が含まれます. Mason の機能セットは初心者を少し圧倒するかもしれませんが, 高品質なドキュメントとヘルプフルなユーザコミュニティがとても役立つものになるでしょう.


HTML::Embperl



Embperl makes its language choice known up front: embedded perl. It is one of the most popular in-line Perl templating tools and has been around longer than most of the others. It has a solid reputation for speed and ease of use.

Embperl は言語の選択を前もって知らせます: 埋め込みの perl. それは最もポピュラーなインライン Perl テンプレーティングツールのひとつで多くの他のツールよりもこなれています. それは速度と使いやすさに定評があります.
It is commonly used in a callback style, with Embperl intercepting URIs and processing the requested file. However, it can optionally be invoked through a subroutine call from another program, allowing it to be used in a pipeline style. Templates are compiled to Perl bytecode and cached.

それは通常 callback スタイルで使われて, Embperl では URI をインターセプトしてリクエストされたファイルを処理します. しかしながら, それはオプションで別のプログラムからサブルーチンコールを通じて呼びだすことができ, pipeline スタイルであつかえるようにします. テンプレートは Perl バイトコードにコンパイルされてキャッシュされます.
Embperl has been around long enough to build up an impressive list of features. It has the ability to run code inside a Safe compartment, support for automatically cleaning up globals to make mod_perl coding easier, and extensive debugging tools including the ability to e-mail errors to an administrator.

Embperl は機能の印象的なリストを構築するほどこなれています. それは Safe 区画の内側でコードを実行する能力, mod_perl コーディングを簡単にするためにグローバル (# 変数 ?) の自動クリーンアップのサポート, それから管理者にエラーを e-mail する能力を含む広範なデバッギングツールを持っています.
The main thing that sets Embperl apart from other in-line Perl systems is its tight HTML integration. It can recognize TABLE tags and automatically iterate over them for the length of an array. It automatically provides sticky form widgets. An array or hash reference placed at the end of a query string in an HREF or SRC attribute will be automatically expanded into query string "name=value" format. META HTTP-EQUIV tags are turned into true HTTP headers.

他のインライン Perl システムから Embperl を区別する主なものはタイトな HTML 統合です. それは TABLE タグを認識して配列の長さの分それらを自動的にイテレート (# 繰り返し) します. スティッキーなフォームウィジェットを自動的に提供します. HREF や SRC アトリビュート内のクエリ文字列の最後におかれた配列やハッシュのリファレンスはクエリストリング "name=value" フォーマットで自動的に展開されます. META HTTP-EQUIV タグは真の HTTL ヘッダに変わります.
Another reason people like Embperl is that it makes some of the common tasks of web application coding so simple. For example, all form data is always available just by reading the magic variable %fdat. Sessions are supported just as easily, by reading and writing to the magic %udat hash. There is also a hash for storing persistent application state. HTML-escaping is automatic (though it can be toggled on and off).

人々が Embperl を好むまた別の理由はそれが web アプリケーションの一般的タスクのいくつかをとてもシンプルにすることです. 例えば, すべてのフォームデータはマジック変数 %fdat を読むだけで常に利用可能です. セッションはマジック %udat ハッシュへの読み書きによって, 同じく簡単にサポートされます. 永続的なアプリケーションの状態を保管するためのハッシュもあります. HTML エスケープは自動です (けれども on と off にトグルできます).
Embperl includes something called EmbperlObject, which allows you to apply OO concepts to your site hierarchy in a similar way to the inheritance features mentioned for Mason, above. This is a very convenient way to code sites with styles that vary by area, and is worth checking out.

Embperl は EmbperlObject と呼ばれるものを含みます, それはあなたが上記の, Mason で言及した継承機能と似たやり方であなたのサイトの階層に OO (# オブジェクト指向) コンセプトを適用することを可能にします. これはエリアによって異なるスタイルでサイトをコーディングするためのとても便利な方法で, チェックする価値があります.
One drawback of older versions of Embperl was the necessity to use built-in replacements for most of Perl's control structures like "if" and "foreach" when they are being wrapped around non-Perl sections. For example:

Embperl の古いバージョンの欠点のひとつは "if" や "foreach" のようなほとんどの Perl の制御構造が非 Perl セクションで周りをラップされているときにそれらのためのビルトインの置き換えの利用が不可欠だったことです. 例えば:

[$ if ($foo) $]
Look like a foo!
[$ else $]
Nope, it's a bar.
[$ endif $]

These may seem out of place in a system based around in-line Perl. As of version 1.2b2, it is possible to use Perl's standard syntax instead:

これらはインライン Perl をベースにしたシステムでは場違いにみえるかもしれません. バージョン 1.2b2 では, 代わりに Perl の標準シンタックスの利用ができます:

[$ if ($foo) { $]
Look like a foo!
[$ } else { $]
Nope, it's a bar.
[$ } $]

At the time of this writing, a new 2.x branch of Embperl is in beta testing. This includes some interesting features like a more flexible parsing scheme which can be modified to users' tastes. it also supports direct use of the Perl debugger on Embperl templates, and provides performance improvements.

これを書いている時点で, Embperl の新しい 2.x ブランチがベータテスト中です. これはユーザのテイストに変更できるよりフレキシブルなパーススキームのようないくつか興味深い機能を含んでいます. また Perl デバッガの直接利用もサポートして, パフォーマンスの向上を提供します.


Apache::ASP



Apache::ASP started out as a port of Microsoft's Active Server Pages technology, and its basic design still follows that model. It uses in-line Perl with a compilation approach, and provides a set of simple objects for accessing the request information and formulating a response. Scripts written for Microsoft's ASP using Perl (via ActiveState's PerlScript) can usually be run on this system without changes. (Pages written in VBScript are not supported.)

Apache::ASP は Microsoft の Active Server Pages (# ASP) テクノロジの移植としてスタートし, 基本設計は今もそのモデルに従っています. それはコンパイルアプローチでのインライン Perl を使い, リクエスト情報にアクセスしてレスポンスを形成するためのシンプルなオブジェクトのセットを提供します. Perl (ActiveState の PerlScript を介した) を使って Microsoft の ASP のために書かれたスクリプトは通常変更することなくこのシステムで走ります. (VBScript で書かれたページはサポートされていません.)
Like the original ASP, it has hooks for calling specified code when certain events are triggered, such as the start of a new user session. It also provides the same easy-to-use state and session management. Storing and retrieving state data for a whole application or a specific user is as simple as a single method call. It can even support user sessions without cookies by munging URLs -- a unique feature among these systems.

オリジナルの ASP のように, それは特定のイベントがトリガされたときに指定されたコードをコールするためのフックをもっています, 新しいユーザセッションの開始などです. またそれは同じ easy-to-use ステート (# 使いやすい状態) とセッションマネージメントを提供します. アプリケーション全体や特定のユーザのためのステートデータの格納と取得はひとつのメソッドコールと同じくらいシンプルです. それは URL をいじくることでクッキーなしにユーザセッションをサポートすることさえできます -- こうしたシステムの中でもユニークな機能です.
A significant addition that did not come from Microsoft ASP is the XML and XSLT support. There are two options provided: XMLSubs and XSLT transforms. XMLSubs is a way of adding custom tags to your pages. It maps XML tags to your subroutines, so that you can add something like <site:header page="Page Title" /> to your pages and have it translate into a subroutine call like &site::header({title => "Page Title"}). It can handle processing XML tags with body text as well.

Microsoft ASP から来ていない重要な追加は XML と XSLT のサポートです. 2 つのオプションが提供されています: XMLSubs と XSLT 変換です. XMLSubs はあなたのページにカスタムタグを追加する方法です. それは XML タグをあなたのサブルーチンにマップするので, あなたはあなたのページに <site:header page="Page Title" /> のようなものを追加してそれが &site::header({title => "Page Title"}) のようなサブルーチンコールへの変換をできるようにします. それは本文テキストを含む XML の処理を扱えるようにします.
The XSLT support allows the output of ASP scripts to be filtered through XSLT for presentation. This allows your ASP scripts to generate XML data and then format that data with a separate XSL stylesheet. This support is provided through integration with the XML::XSLT module.

XSLT のサポートは XSLT を通じて表示のために ASP スクリプトのアウトプットをフィルタできるようにします. これはあなたの ASP スクリプトが XML データを作成して別の XSL スタイルシートでそのデータをフォーマットできるようにします. このサポートは XML::XSLT モジュールとの統合を通じて提供されます.
Apache::ASP provides sticky widgets for forms through the use of the HTML::FillInForm module. It also has built-in support for removing extra whitespace from generated output, gzip compressing output (for browsers that support it), tracking performance using Time::HiRes, automatically mailing error messages to an administrator, and many other conveniences and tuning options. This is a mature package which has evolved to handle real-world problems.

Apache::ASP は HTML::FillInForm モジュールの利用を通じてフォームのためのスティッキーなウィジェットを提供します. それはまた生成されたアウトプットからの余分な空白の削除のビルトインサポート, アプトプットの gzip 圧縮 (それをサポートするブラウザ用), Time::HiRes を使ったパフォーマンスのトラッキング, 管理者への自動的なエラーメッセージのメール, およびその他多くの便利なものやチューニングオプションも持っています. これは現実世界の問題を扱うために進化した成熟したパッケージです.
One thing to note about the session and state management in this system is that it currently only supports clusters through the use of network filesystems like NFS or SMB. (Joshua Chamas, the module's author, has reported much better results from Samba file-sharing than from NFS.) This may be an issue for large-scale server clusters, which usually rely on a relational database for network storage of sessions. Support database storage of sessions is planned for a future release.

このシステムでセッションとステートのマネージメントに関して注意すべきひとつのことはそれが NFS や SMB のようなネットワークファイルシステムの利用を通じたクラスタのみを現在サポートしていることです. (このモジュールの作者, Joshua Chamas は, NFS よりも Samba ファイル共有の方がかなりベターな結果をもっていると報告しています.) これは通常セッションのネットワークストレージがリレーショナルデータベースに依存する, 大規模なスケールのサーバクラスタで課題になるかも知れません. セッションのデータベースストレージのサポートは将来のリリースで計画されています.


Text::Template



This module has become the de facto standard general purpose templating module on CPAN. It has an easy interface and thorough documentation. The examples in the docs show a pipeline execution style, but it's easy to write a mod_perl handler that directly invokes templates, allowing a callback style. The module uses in-line Perl. It has the ability to run the in-line code in a Safe compartment, in case you are concerned about mistakes in the code crashing your server.

このモジュールは CPAN でデファクトスタンダードの汎用テンプレーティングモジュールになりました. それは簡単なインターフェイスと綿密なドキュメントをもっています. そのドキュメントの例は pipline 実行スタイルを示しますが, 直接テンプレートを呼びだす mod_perl ハンドラを書いて, 簡単に callback スタイルを許可できます. このモジュールはインライン Perl を使います. それはあなたがコードのミスであなたのサーバをクラッシュすることを心配するようなケースを Safe 区画でインラインコードを実行する能力を持っています.
The module relies on creative uses of in-line code to provide things that people usually expect from templating tools, like includes. This can be good or bad. For example, to include a file you could just call Text::Template::fill_in_file(filename). However, you'll have to specify the complete file path and nothing will stop you from using /etc/passwd as the file to be included. Most of the fancier templating tools have concepts like include paths, which allow you to specify a list of directories to search for included files. You could write a subroutine that works this way, and make it available in your template's namespace, but it's not built in.

このモジュールはインクルードのような, テンプレーティングツールに人々が通常期待するものを提供するためにインラインコードの想像的な利用に依拠しています. これは良くも悪くもです. 例えば, ファイルをインクルードするためにあなたは Text::Template::fill_in_file(filename) をコールするだけのはずです. しかし, あなたが完全なファイルパスを指定しなければならないとしてあなたがインクルードされるファイルに /etc/passwd を使うことをストップするものがありません. より手の込んだテンプレーティングツールのほとんどはインクルードパスのようなコンセプトを持っていて, それはあなたにインクルードされるファイルを検索するディレクトリのリストを指定できるようにします. あなたはこのやり方で機能するサブルーチンを書くことができて, あなたのテンプレートの名前空間で利用可能にすることができますが, それはビルトインはありません.
Each template is loaded as a separate object. Templates are compiled to Perl and only parsed the first time they are used. However, to take full advantage of this caching in a persistent environment like mod_perl, your program will have to keep track of which templates have been used, since Text::Template does not have a way of globally tracking this and returning cached templates when possible.

各テンプレートは別々のオブジェクトとしてロードされます. テンプレートは Perl にコンパイルされてそれが使われる最初の時点でのみパースされます. しかし, mod_perl のように永続的な環境でこのキャッシングのフルアドバンテージをとるために, あなたのプログラムはどのテンプレートが使われたかを追跡しなければなりません, Text::Template がグローバルにこれをトラッキングして可能な場合にキャッシュされたテンプレートをリターンする方法をもっていないからです.
Text::Template is not tied to HTML, and is just a templating module, not a web application framework. It is perfectly at home generating e-mails, PDFs, etc.

Text::Template は HTML に縛られておらず, 単なるテンプレーティングツールであり, web アプリケーションフレームワークではありません. それは e-mail, PDFs, etc の生成に完璧になじんでいます.


Template Toolkit



One of the more recent additions to the templating scene, Template Toolkit is a very flexible mini-language system. It has a complete set of directives for working with data, including loops and conditionals, and it can be extended in a number of ways. In-line Perl code can be enabled with a configuration option, but is generally discouraged. It uses compilation, caching the compiled bytecode in memory and optionally caching the generated Perl code for templates on disk. Although it is commonly used in a pipeline style, the included Apache::Template module allows templates to be invoked directly from URLs.

テンプレートシーンにごく最近追加されたものの 1 つ, Template Toolkit はとてもフレキシブルなミニ言語システムです. それはループ条件を含む, データと連動する完全なセットを持ち, 数々の方法で拡張できます. インライン Perl コードは構成オプションで有効化できますが, 一般的には勧められません. それはコンパイルを使用し, コンパイルされたバイトコードをメモリにキャッシュしてオプションでテンプレートのために生成された Perl コードをディスク上にキャッシュします. 通常それはパイプラインスタイルで使われますが, インクルードされた Apache::Template モジュールは URL から直接呼びだせるようにします.
Template Toolkit has a large feature set, so we'll only be able cover some of the highlights here. The TT distribution sets a gold standard for documentation thoroughness and quality, so it's easy to learn more if you choose to.

Template Toolkit は大きな機能のセットをもっているので, 私たちはここでいくつかのハイライトのみをカバーします. TT (# Template Toolkit) ディストリビューションはドキュメントの完璧さと品質をゴールドスタンダード (# 絶対的な基準) にセットしているので, もしあなたがその気ならより簡単により多くを学ぶことができます.
One major difference between TT and other systems is that it provides simple access to complex data structures through the concept of a dot operator. This allows people who don't know Perl to access nested lists and hashes or call object methods. For example, we could pass in this Perl data structure:

TT と他のシステムの主な違いのひとつはドットオペレータのコンセプトを通じて複雑なデータ構造へのシンプルなアクセスを提供することです. これはこれは Perl を知らない人々がネストされたリストやハッシュへのアクセスやオブジェクトメソッドのコールをできるようにします. 例えば, 私たちはこの Perl データ構造を渡すことができます:

$vars = {
customer => {
name => 'Bubbles',
address => {
city => 'Townsville',
}
}
};

Then we can refer to the nested data in the template:

それから私たちはテンプレートでネストされたデータを参照できます:

Hi there, [% custmer.name %]!
How are thing in [% customer.address.city %]?

This is simpler and more uniform than the equivalent syntax in Perl. If we pass in an object as part of the data structure, we can use the same notation to call methods within that object. If you've modeled your system's data as a set of objects, this can be very convenient.

これは Perl での同等のシンタックスよりもずっとシンプルでより統一的です. もし私たちデータ構造の一部としてオブジェクトを渡す場合, 私たちはそのオブジェクトのメソッドをコールするために同じ記法を使うことが出来ます. あなたがあなたのシステムのデータをオブジェクトのセットとしてモデル化した場合, これはとても便利になります.
Templates can define macros and include other templates, and parameters can be passed to either. Included templates can optionally localize their variables so that changes made while the included template is executing do not affect the values of variables in the larger scope.

テンプレートはマクロの定義や他のテンプレートをインクルードできて, パラメータをそれぞれに渡すことができます. インクルードされたテンプレートはオプションでその変数をローカライズできるのでインクルードされたテンプレートが実行されている間での変更がより大きなスコープでの変数の値に影響しないようにします.
There is a filter directive, which can be used for post-processing output. Uses for this range from simple HTML entity conversion to automatic truncation (useful for pulldown menus when you want to limit the size of entries) and printing to STDERR.

フィルタディレクティブがあり, それはポストプロセスのアウトプットに使うことができます. この用途はシンプルな HTML エンティティ変換からオートマチックトランケーション (# 自動切り捨て) (あなたがエントリサイズの制限を希望するときのプルダウンメニューで便利) や STDERR への出力に及びます.
TT supports a plugin API, which can be used to add extra capabilities to your templates. The provided plugins can be broadly organized into data access and formatting. Standard data access plugins include modules for accessing XML data or a DBI data source and using that data within your template. There's a plugin for access to CGI.pm as well.

TT はプラグイン API をサポートしていて, それはあなたのテンプレートのための追加の能力を加えるために使われます. 提供されるプラグインは大まかにデータアクセスとフォーマットで構成されています. 標準的なデータアクセスプラグインは XML データや DBI データソースにアクセスするモジュールを含んでいてあなたのテンプレートでそのデータを利用します. CGI.pm にアクセスするプラグインもあります.
Formatting plugins allow you to display things like dates and prices in a localized style. There's also a table plugin for use in displaying lists in a multi-column format. These formatting plugins do a good job of covering the final 5% of data display problems that often cause people who are using an in-house system to embed a little bit of HTML in their Perl modules.

フォーマットのプラグインはローカライズスタイルでの日付や価格のようなものをあなたが表示できるようにします. リストをマルチカラムのフォーマットで表示するために使うテーブルプラグインもあります. これらのフォーマットプラグインは内製システムを使う人たちが Perl モジュールにちょっとした HTML を埋め込むためによく起こすデータ表示の問題の最後の 5% をいい感じでカバーします.
In a similar vein, TT includes some nice convenience features for template writers like eliminating white space around tags and the ability to change the tag delimiters -- things that may sound a little esoteric, but can sometimes make templates significantly easier to work with.

同じように, TT はタグ周辺の空白を削除したりタグのデリミタ (# 区切り文字) を変更する機能のようなテンプレート作者のためのいくつかナイスで便利な機能を含みます -- 少し難解に聞こえるかもしれませんが, テンプレートの作業をかなり簡単にしてくれる場合があります.
The TT distribution also includes a script called ttree which allows for processing an entire directory tree of templates. This is useful for sites that pre-publish their templated pages and serve them statically. The script checks modification times and only updates pages that require it, providing a make-like functionality. The distribution also includes a sample set of template-driven HTML widgets which can be used to give a consistent look and feel to a collection of documents.

TT ディストリビューションはテンプレートのディレクトリツリー全体を処理できるようにする ttree と呼ばれるスクリプトも含みます. これはそのテンプレートを事前に公開しそれらを静的に提供するサイトで便利です. そのスクリプトは変更時刻をチェックして必要なページのみをアップデートする, make のような機能を提供します. このディストリビューションはドキュメントのコレクションに一貫性のあるルックアンドフィールを与えるテンプレートドリブンのHTML ウィジェットのサンプルセットも含みます.


HTML::Template



HTML::Template is a popular module among those looking to use a mini-language rather than in-line Perl. It uses a simple set of tags which allow looping (even on nested data structures) and conditionals in addition to basic value insertion. The tags are intentionally styled to look like HTML tags, which may be useful for some situations.

HTML::Template はインライン Perl でなくミニ言語を使おうとしている人たちの間でポピュラーなモジュールです. それは基本的な値の挿入に加えてループ (ネストされたデータ構造でさえ) と条件が利用可能なシンプルなタグのセットを使用します. そのタグは HTML タグのようなスタイルを意図していて, それはいくつかの状況で便利なはずです.
As the documentation says, it "does just one thing and it does quickly and carefully" -- there is no attempt to add application features like form-handling or session tracking. The module follows a pipeline execution style. Parsed templates are stored in a Perl data structure which can be cached in any combination of memory, shared memory (using IPC::SharedCache), and disk. The documentation is complete and well-written, with plenty of examples.

ドキュメントがいうように, それは "ひとつのことだけを実行しそれをクイックかつ慎重に行います" -- フォーム処理ややセッショントラッキングのようなアプリケーションの機能を追加する試みはありません. このモジュールは pipeline 実行スタイルをフォローします. パースされたテンプレートは Perl データ構造に格納されメモリ, 共有メモリ (IPC::SharedCahce), それからディスクの任意の組み合わせでキャッシュできます. ドキュメントは完全でよく書かれていて, 例が豊富です.
You may be wondering how this module is different from Template Toolkit, the other popular mini-language system. Beyond the obvious differences in syntax, HTML::Template is faster and simpler, while Template Toolkit has more advanced features, like plugins and dot notation. Here's a simple example comparing the syntax:

あなたはこのモジュールが別のポピュラーなミニ言語システム, Template Toolkit とどのように違うのか不思議に思うかもしれません. シンタクスの明かな違いを超えて, HTML::Template が高速かつシンプルである一方で, Template Tookit はプラグインやドット記法のような, より高度な機能を持っています. こちらはシンタクスを比較するシンプルな例です:
HTML::Template:

<TMPL_LOOP list>
<a href="<TMPL_VAR url>"><b><TMPL_VAR name></b></a>
</TMPL_LOOP>

Template Toolkit:

[% FOREACH list %]
<a href="[% url %]"><b>[% name %]</b></a>
[% END %]

And now, a few honorable mentions:

では, いくつかの佳作を:


AxKit2



Previous versions of this document covered Apache::AxKit. However, the coverage was not very good and that project has since been replaced by AxKit2.

このドキュメントの以前のバージョンは Apache::AxKit をカバーしていました. しかしながら, そのカバレッジはあまりグッドではなくそのプロジェクトは後に AxKit2 にリプレイスされました.
Like its predecessor, AxKit2 is all about XML. It is more of a framework than a templating system per se, but includes support for multiple templating systems within it. The systems supported in the core release include XSLT, TAL (see the notes on Petal and Template::TAL below), XSP, an XML-based mini-language which can be extended with your own tags, and facilities for writing custom tag libraries.

前任者と同じく, AxKit2 はすべて XML についてのものです. それは本来テンプレーティングシステムというようりもフレームワークですが, その中に複数のテンプレーティングシステムのサポートを含んでいます. そのコアリリースでサポートされるシステムは XSLT, TAL (以下の Petal と Template::TAL の注記を参照), XPS, あなた独自のタグで拡張できる XML ベースのミニ言語, それからカスタムタグライブラリを書くための機能を含みます.
Rather than short-change AxKit2 here with an inadequate description, I would encourage people who are intrigued by what they've heard so far to go and check out AxKit2 on CPAN. If you like working with XML, this may be a very good fit for you.

ここで AxKit2 の不十分な説明をするよりも, 私はここまでに聞いたことに興味をもった人たちには CPAN で AxKit2 をチェックすることをお勧めします. もしあなたが XML で作業することを好むなら, これはあなたにとてもグッドにフィットするかもしれません.


HTML_Tree



As mentioned earlier, HTML Tree uses a fairly unique method of templating: it loads in an HTML page, parses it to a DOM, and then programmatically modifies the contents of nodes. This allows it to use genuine valid HTML documents as templates, something which none of these other modules can do. The learning curve is a little steeper than average, but this may be just the thing if you are concerned about keeping things simple for your HTML coders. Unfortunately, HTML_Tree seems to be a dead project at this point and has not had an update in years. (Note that the name is "HTML_Tree", not "HTML::Tree".)

前述のとおり, HTML Tree はテンプレーティングのかなりユニークなメソッドを使います: それは HTML ページをロードし, DOM にパースして, それからノードのコンテンツをプログラム的に変更します. これはテンプレートとして本物の有効な HTML ドキュメントの利用を可能にします, それは他のどのモジュールもできないことです. 学習曲線は平均よりも少し急ですが, あなたがあなたの HTML コーダーのために物事をシンプルに維持することに関係しているならこれはちょうどよいものかもしれません. 残念ながら, HTML_Tree は現在 dead プロジェクトのように見えますし何年もアップデートをもっていません. (名前は "HTML::Tree" でなく, "HTML_Tree" であることに注意してください.)


Petal and Template::TAL



Both of these modules are based on the TAL templating language created by the developers of the (Python) Zope CMS. (Petal offers some additions, while Template::TAL tries to be a strict implementation of the TAL spec.) The basic idea is to make your templates XML documents and use attributes in a TAL namepace to specify data, loops, and conditionals. This means it is essentially using a mini-language, but the templates end up being valid XML documents, which allows them to be edited with XML tools.

これらのモジュールは両方とも (Python) Zope CMS の開発者によって作成された TAL テンプレーティング言語に基づいています. (Petal はいくつかの追加を提供しますが, Template::TAL は TAL スペックの厳密に実装することをトライしています.) 基本的なアイデアはあなたのテンプレートを XML ドキュメントにして TAL ネームスペースのアトリビュートを使ってデータ, ループや条件を指定することです. これはそれが本質的にミニ言語を使うことを意味しますが, テンプレートは最後に有効な XML ドキュメントになり, それは XML ツールでそれらを編集できるようにします.
There are a couple of downsides to TAL. One is the verbosity. Compared to most of the other tools listed here, TAL is very verbose. This is a consequence of using XML attributes for everything. Here's an example from the Template::TAL docs:

TAL にはふたつの欠点があります. ひとつは冗長性です. ここにリストされた他のほとんどのツールと比較して, TAL はとても冗長です. これはすべてに XML アトリビュートを使用する結果です. こちらは Template::TAL ドキュメントからの例です:

<li tal:repeat="user users">
<a href="?" tal:attributes="href user/url"><span tal:replace="user/name"/></a>
</li>

The other issue is the need for your templates to be valid XML (most likely XHTML). Petal attempts to be more forgiving by implementing a custom parser and allowing XHTML and HTML. This should allow the use of WYSIWYG tools to edit templates. In practice though, the custom parser is easily confused by HTML that browsers would handle without a problem. A custom parser is also problematic from a maintenance perspective since it doesn't benefit from improvements in the commonly used XML parsers. Template::TAL uses XML::LibXML.

もうひとつの課題はあなたのテンプレートが有効な XML (おそらく XHTML) であることを必要とすることです. Petal はカスタムパーサを実装して XHTML と HTML を許可することでより寛容になることを試みています. これはテンプレートの編集に WYSIWYG (# What You See Is What You Get, 見たものが得るもの) ツールの利用を可能にするはずです. けれども実際のところ, そのカスタムパーサはブラウザが問題なく処理できる HTML によって簡単に混乱します. またカスタムパーサは一般的に使われる XML パーサの改善からのベネフィットをえられないのでメンテナンスの観点からも問題があります. Template::TAL は XML::LibXML を使います.
Both Petal and Template::TAL have seen relatively recent maintenance releases, which makes them a much safer bet than HTML_Tree at this point.

Petal と Template::TAL はどちらも比較的最近メンテナンスリリースがあり, それは現時点でこれらを HTML_Tree よりもかなり安全な策にします.


ePerl



Possibly the first module to embed Perl code in a text or HTML file, ePerl is getting a bit long in the tooth. The mod_perl-aware version, Apache::ePerl, caches compiled bytecode in memory to achieve solid performance, and some people find it refreshingly simple to use. However, it lacks many of the features that the other more modern systems have, and may be difficult to compile on recent versions of Perl.

おそらくテキストや HTML ファイルに Perl コードを埋め込むための最初のモジュールである, ePerl はすこし古くなっています. その mod_perl 認識 (# 対応) バージョン, Apache::ePerl は, 堅牢なパフォーマンスを達成するためにメモリにコンパイルされたバイトコードをキャッシュし, 一部の人たちはそれをスッキリとシンプルに使えると思っています. しかしながら, それは他のよりモダンなシステムがもっている多くの機能が欠けていて, 最近のバージョンの Perl 上でコンパイルするのは難しいかもしれません.


CGI::FastTemplate



This module takes a minimalistic approach to templating, which makes it unusually well suited to use in CGI programs. It parses templates with a single regular expression and does not support anything in templates beyond simple variable interpolation. Loops are handled by including the output of other templates. Unfortunately, this leads to a Perl coding style that is more confusing than most, and a proliferation of template files. However, some people swear by this dirt-simple approach.

このモジュールはテンプレーティングにミニマルなアプローチをとっているので, CGI プログラムでの利用にかなり適しています. それは単一の正規表現でテンプレートをパースしてシンプルな変数を挿入する以上のテンプレート内にある何かはサポートしません. ループは他のテンプレートの出力をインクルードすることで処理されます. 残念ながら, これは大抵より混乱する Perl のコーディングスタイルと, テンプレートファイルの急増をまねきます. しかしながら, 一部の人たちはこのごくシンプルなアプローチを信頼しています.


パフォーマンス : Performance



People always seem to worry about the performance of templating systems. If you've ever built a large-scale application, you should have enough perspective on the relative costs of different actions to know that your templating system is not the first place to look for performance gains. All of the systems mentioned here have excellent performance characteristics in persistent execution environments like mod_perl. Compared to such glacially slow operations as fetching data from a database or file, the time added by the templating system is almost negligible.

人々はテンプレーティングシステムのパフォーマンスについて常に心配しているようにみえます. あなたがこれまでに大規模アプリケーションを構築したことがあるなら, あなたはあなたのテンプレーティングシステムがパフォーマンスゲインを探す最初の場所でないことを知るためにさまざまなアクションの相対的なコストに十分な見通しをもつべきです. ここで言及するすべてのシステムは mod_perl のような永続的な実行環境で優れたパフォーマンス特性をもっています. データベースやファイルからデータを取得するような氷河のように遅いオペレーションと比較して, テンプレーティングシステムによって追加される時間はほとんど無視できます.
If you think your templating system is slowing you down, get the facts: pull out Devel::DProf and see. If one of the tools mentioned here is at the top of the list for wall clock time used, you should pat yourself on the back -- you've done a great job tuning your system and removing bottlenecks! Personally, I have only seen this happen when I had managed to successfully cache nearly every part of the work to handle a request except running a template.

もしあなたがあなたのテンプレーティングシステムがあなたの足手まといになっていると考えているなら, 事実をゲットしてください: Devel::Dprof を引っ張り出して確認します. ここで言及されたツールのひとつが使用される実時間 (# wall clock time) のリストのトップにあるなら, あなたはあなたを褒めるべきです -- あなたはあなたのシステムを調整してボトルネックを解消するグレートな仕事をしたのです! 個人的に, 私は私がテンプレートを実行する以外のリクエストを処理するほぼすべての作業のキャッシュに成功したときにのみこれが見られました.
However, if you really are in a situation where you need to squeeze a few extra microseconds out of your page generation time, there are performance differences between systems. They're pretty much what you would expect: systems that do the least run the fastest. Using in-line print() statements is faster than using templates. Using simple substitution is faster than using in-line Perl code. Using in-line Perl code is faster than using a mini-language.

しかしながら, 本当にあなたがあなたのページ生成タイムの余分な数マイクロ秒をあなたが搾る必要があるシチュエーションにいるなら, システム間でパフォーマンスの違いがあります. それらはあなたが予想するものとほとんどマッチします: もっとも少ない実行を行うシステムがもっとも高速です. インラインの print() ステートメントの利用はテンプレートの利用よりも高速です. シンプルな置換の利用はインラインの Perl コードの利用よりも高速です. インライン Perl コードの利用はミニ言語の利用よりも高速です.
The only templating benchmark available at this time is one developed by Joshua Chamas, author of Apache::ASP. It includes a "hello world" test, which simply checks how fast each system can spit back those famous words, and a "hello 2000" test, which exercises the basic functions used in most dynamic pages. It is available from the following URL:

現時点で利用可能な唯一のテンプレーティングベンチマークは Apache::ASP の作者, Joshua Chamas によって開発されたものです. それは各システムがどのくらいに高速にそれら有名なワードを吹き返すかをシンプルにチェックする, "hello world" テスト, ほとんどの動的ページで使われる基本的な機能を試行する, "hello 2000" テストを含みます. それは次の URL から利用可能です:

http://www.chamas.com/bench/hello.tar.gz (# can't reach this page)

Results from this benchmark currently show SSI, Apache::ASP, and HTML::Embperl having the best performance of the lot. Not all of the systems mentioned here are currently included in the test. If your favorite was missed, you might want to download the benchmark code and add it. As you can well imagine, benchmarking people's pet projects is largely a thankless task and Joshua deserves some recognition and support for this contribution to the community.

このベンチマークの結果は現在 SSI, Apache::ASP, それから HTML::Embperl が数あるなかでベストのパフォーマンスをもっていることを示します. このテストには現在ここで言及されたすべてのシステムを含んだものではありません. もしあなたのお気に入りが見落とされているなら, あなたはベンチマークコードをダウンロードしてそれを追加してみるとよいでしょう. あなたが想像するとおり, ベンチマークをする人々のペットプロジェクト (# 長期的な企画) は大部分が報われないタスクですが Joshua のこのコミュニティへの貢献は何かしらの評価とサポートを受けるに相応しいものです.


CGI パフォーマンスの懸念 : CGI Performance Concerns



If you're running under CGI, you have bigger fish to fry than worrying about the performance of your templating system. Nevertheless, some people are stuck with CGI but still want to use a templating system with reasonable performance. CGI is a tricky situation, since you have to worry about how much time it will take for Perl to compile the code for a large templating system on each request. CGI also breaks the in-memory caching of templates used by most of these systems, although the slower disk-based caching provided by Mason, HTML::Template, and Template Toolkit will still work. (HTML::Template does provide a shared memory cache for templates, which may improve performance, although shared memory on my Linux system is usually slower than using the filesystem. Benchmarks and additional information are welcome.)

もしあなたが CGI のもとで実行しているなら, あなたにはあなたのテンプレーティングシステムのパフォーマンスを心配するよりももっと大事なことがあります. それでもなお, 一部の人々は CGI 上で立ち往生しつつも妥当なパフォーマンスのテンプレーティングシステムを使いたいと思っています. CGI はトリッキーなシチュエーションです, 各リクエストで Perl が大規模なテンプレーティングシステムのためのコードをコンパイルするのにどのくらいの時間を要するかを心配しなければならないからです. CGI はこれらのシステムのほとんどにより使用されるメモリ内のテンプレートのキャッシュも中断しますが, Mason, HTML::Template, それから Template Toolkit により提供されるより低速なディスクベースのキャッシングは機能し続けます. (HTML::Template はテンプレート用の共有メモリキャッシュを提供します, それはパフォーマンスを向上するかもしれませんが, 私の Linux システムの共有メモリは通常ファイルシステムを使うよりも低速です. ベンチマークや追加の情報は歓迎します.)
Your best performance bet with CGI is to use one of the simpler tools, like CGI::FastTemplate or Text::Template. They are small and compile quickly, and CGI::FastTemplate gets an extra boost since it relies on simple regex parsing and doesn't need to eval any in-line Perl code. Almost everything else mentioned here will add tenths of seconds to each page in compilation time alone.

CGI でのあなたのパフォーマンスの最善策は CGI::FastTemplate や Text::Template のような, シンプルなツールのひとつを使うことです. それらはシンプルかつクイックにコンパイルされ, CGI::FastTemplate はシンプルな正規表現解析に依存しあらゆるインライン Perl コードの評価を必要としないので追加のブーストをゲットします. ここで言及された他のほとんどすべてはコンパイルタイムだけで各ページに 10 分の 1 秒を追加するでしょう.


アップデート : Updates



These modules are moving targets, and a document like this is bound to contain some mistakes. Send your corrections to <perrin (at) elem.com>. Future versions of this document will be announced on the mod_perl mailing list, and possibly other popular Perl locations as well.

これらのモジュールは動くターゲットであり, このようなドキュメントはいくつかの間違いを必ず含んでいます. あなたの校正を <perrin (at) elem.com> に送信してください. このドキュメントの将来のバージョンは mod_perl メーリングリスト, それからおそらく他のポピュラーな Perl の場所でアナウンスされることになるはずです.

by Perrin Harkins


メンテナ : Maintainers



Maintainer is the person(s) you should contact with updates, corrections and patches.



作者 Authors




Only the major authors are listed above. For contributors see the Changes file.


NEXT



次回は、「 Documentation / Tutorials / Part III: Tips and Tricks / Cute Tricks With Perl and Apache 」を「 mod_perl 」公式サイト (https://perl.apache.org/index.html) より確認する予定です。


参考情報は書籍「 続・初めての Perl 改訂版 」, 「 Effective Perl 第 2 版 」を中心に perldoc, Wikipedia および各 Web サイト。それと詳しい先輩。

目次 - Perl Index






















関連記事