blog20100901

2013/08/20 - プログラミング言語 Perl にまつわる etc. - Perl monger
参考 : perldoc, perldoc.jp, search.cpan.org, perldoc.perl.org ...
「 初めての Perl 第 6 版 」(オライリー・ジャパン発行 ISBN978-4-87311-567-2) 」
「 続・初めての Perl 改訂版 」(オライリー・ジャパン発行 ISBN4-87311-305-9) 」
「 Effective Perl 第 2 版 」(翔泳社発行 ISBN978-4-7981-3981-4) 」 ... etc,.

Perl Perl_7 mod_perl 翻訳 Web Server

Perl mp2 翻訳 CPAN のための mod_perl モジュールの準備 (d208)

目次 - Perl Index


Theme



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

今回は、「 Documentation / General Documentation / Part II: Packaging and Testing / Preparing mod_perl modules for CPAN 」を翻訳して確認します。

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




説明: Description



This document provides information for CPAN modules developers whose modules require mod_perl.

このドキュメントは mod_perl を必要とするモジュールの CPAN モジュール開発者のための情報を提供します。


mod_perl を必要とする Makefile.PL の前提条件を定義する : Defining Makefile.PL Prerequisites that Require mod_perl



If there are any prerequisites that need to be defined in Makefile.PL, but require a mod_perl environment to successfully get loaded, the following workaround can be used. The following example will specify two prerequisites: CGI.pm and Apache::DBI, the latter can be loaded only under mod_perl whereas the former can be loaded from the command line.

Makefile.PL 内で定義する必要があるが, 正常にロードするために mod_perl 環境を要求する前提条件がある場合は, 次の回避策が使えます。次の例は 2 つの前提条件を指定します: CGI.pm と Apache::DBI, 後者は mod_perl のもとでのみロードでき前者はコマンドラインからロードできます。

file:Makefile.PL
----------------
use ExtUtils::MakeMaker;

# set prerequisites
my %prereq = (
'CGI' => 2.71,
);

# Apache::DBI がインストールされているかを手動でテストして
# もしそれがインストールされていなければそれを PREREQ_PM に追加するので,
# CPAN.pm は自動的にそれをフェッチする。Apache::DBI が既にインストールされていれば
# それはロードするために mod_perl 環境を必要とするので MakeMaker によるロードは失敗する。
# ---
# Manually test whether Apache::DBI is installed and add it to the
# PREREQ_PM if it's not installed, so CPAN.pm will automatically fetch
# it. If Apache::DBI is already installed it will fail to get loaded by
# MakeMaker because it requires the mod_perl environment to load.
eval { require Apache::DBI };
if ($@ && $@ !~ /Can't locate object method/) {
$prereq{'Apache::DBI'} = 0.87;
}

WriteMakefile(
NAME => 'Apache::SuperDuper',
VERSION_FROM => 'SuperDuperl.pm',
PREREQ_PM => \%prereq,
# ... the rest
);

Notice that Can't locate object method is a part of the error generated when Apache::DBI is installed but is attempted to be loaded outside of mod_perl, e.g. at the command line, which is the case with Makefile.PL.

Can't locate object method は Apache::DBI がインストールされているが mod_perl の外側でのロードをここ見ているときに生成されるエラーの一部であることに注意してください, e.g. コマンドライン上での, Makefile.PL のケース。


テストスイートを書く : Writing the Test Suite



The Apache::Test framework provides an easy way to test modules which require mod_perl (or Apache in general), be it 1.0 or 2.0 generation. Here is the complete guide to the Apache::Test framework.

Apache::Test フレームワークは世代 1.0 でも 2.0 でも, mod_perl (or 一般的には Apahce) が必要とするモジュールをテストするための簡単な方法を提供します。こちらが (#a)the complete guide to the Apache::Test fremework です。


メンテナ : Maintainers



Maintainer is the person(s) you should contact with updates, corrections and patches.
  • Stas Bekman [http://stason.org/]



作者 : Authors



  • Stas Bekman [http://stason.org/]



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


NEXT



次回は、「 Documentation / General Documentation / Part II: Packaging and Testing / Running and Developing Tests with the Apache::Test Framework 」を「 mod_perl 」公式サイト (https://perl.apache.org/index.html) より確認します。


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

目次 - Perl Index

































同じカテゴリー(Perl)の記事
 Perl mp2 翻訳 Web コンテンツ圧縮の FAQ (d228) (2023-10-11 23:49)
 Perl mp2 翻訳 既知のブラウザのバグの回避策をいくつか (d227) (2023-05-26 15:41)
 Perl mp2 翻訳 Perl と Apache でのキュートなトリック (d226) (2023-05-19 17:05)
 Perl mp2 翻訳 テンプレートシステムの選択 (d225) (2022-08-15 22:23)
 Perl mp2 翻訳 大規模 E コマースサイトの構築 (d224) (2022-06-15 20:43)
 Perl mp2 翻訳 チュートリアル (d223) (2022-06-15 20:42)
上の画像に書かれている文字を入力して下さい
 
<ご注意>
書き込まれた内容は公開され、ブログの持ち主だけが削除できます。

Llama
リャマ
TI-DA
てぃーだブログ
プロフィール
セラ (perlackline)
セラ (perlackline)
QRコード
QRCODE
オーナーへメッセージ

PAGE TOP ▲