perlmodstyle > 5.20.1 との差分

perlmodstyle 5.20.1 と 5.16.1 の差分

11
22=encoding euc-jp
33
44=head1 NAME
55
66=begin original
77
88perlmodstyle - Perl module style guide
99
1010=end original
1111
1212perlmodstyle - Perl モジュールスタイルガイド
1313
1414=head1 INTRODUCTION
1515
1616=begin original
1717
1818This document attempts to describe the Perl Community's "best practice"
1919for writing Perl modules. It extends the recommendations found in
2020L<perlstyle> , which should be considered required reading
2121before reading this document.
2222
2323=end original
2424
2525このドキュメントは Perl コミュニティにおける
2626Perl モジュールを書くときの「ベストプラクティス」を
2727説明しています。
2828これは L<perlstyle> にある推奨項目を拡張します;
2929L<perlstyle> はこのドキュメントに先立って目を通しておいてください。
3030
3131=begin original
3232
3333While this document is intended to be useful to all module authors, it is
3434particularly aimed at authors who wish to publish their modules on CPAN.
3535
3636=end original
3737
3838このドキュメントは全てのモジュール作者に役立つように
3939意図していますが、CPAN にモジュールを公開しようと
4040している作者を特に意図しています。
4141
4242=begin original
4343
4444The focus is on elements of style which are visible to the users of a
4545module, rather than those parts which are only seen by the module's
4646developers. However, many of the guidelines presented in this document
4747can be extrapolated and applied successfully to a module's internals.
4848
4949=end original
5050
5151焦点は、モジュール開発者の目にとまる点ではなく、
5252モジュールのユーザの目にとまるスタイルの要素に置かれています。
5353しかし、このドキュメントであげられているガイドラインの
5454多くはモジュールの内部にも推測、適用できるでしょう。
5555
5656=begin original
5757
5858This document differs from L<perlnewmod> in that it is a style guide
5959rather than a tutorial on creating CPAN modules. It provides a
6060checklist against which modules can be compared to determine whether
6161they conform to best practice, without necessarily describing in detail
6262how to achieve this.
6363
6464=end original
6565
6666L<perlnewmod> は CPAN モジュールを作るためのチュートリアルであるのに対し、
6767この文書はスタイルに関するガイドという点で異なっています。
6868それはモジュールがベストプラクティスに沿っているかを
6969これを成し遂げる方法を詳細に記述する必要なしに
7070決定するために比較するためのチェックリストを
7171提供しています。
7272
7373=begin original
7474
7575All the advice contained in this document has been gleaned from
7676extensive conversations with experienced CPAN authors and users. Every
7777piece of advice given here is the result of previous mistakes. This
7878information is here to help you avoid the same mistakes and the extra
7979work that would inevitably be required to fix them.
8080
8181=end original
8282
8383このドキュメントに含まれる全てのアドバイスは
8484経験に富んだ CPAN 作者及びユーザの広範囲にわたる
8585議論から少しずつ集められています。
8686ここにあるアドバイスのどの欠片も以前の過ちの解決として
8787生まれました。
8888この情報は同じ過ちを繰り返さないように、
8989そして必然的にそれらを修正するという余計な作業が
9090必要とならないように、あなたを手助けするために
9191ここにあります。
9292
9393=begin original
9494
9595The first section of this document provides an itemized checklist;
9696subsequent sections provide a more detailed discussion of the items on
9797the list. The final section, "Common Pitfalls", describes some of the
9898most popular mistakes made by CPAN authors.
9999
100100=end original
101101
102102このドキュメントの最初のセクションでは項目別のチェックリストを
103103提供します; その後のセクションではリストの各項目について
104104より詳しい説明を行います。
105105そして最後のセクション、「よくある落とし穴」で CPAN 作者が
106106よくやってしまう、特にメジャーな失敗をいくつか説明します。
107107
108108=head1 QUICK CHECKLIST
109109
110110(クイックチェックリスト)
111111
112112=begin original
113113
114114For more detail on each item in this checklist, see below.
115115
116116=end original
117117
118118このチェックリストにおける各項目の詳細は後のセクションを
119119参照してください。
120120
121121=head2 Before you start
122122
123123(始める前に)
124124
125125=over 4
126126
127127=item *
128128
129129=begin original
130130
131131Don't re-invent the wheel
132132
133133=end original
134134
135135車輪の再発明をしない
136136
137137=item *
138138
139139=begin original
140140
141141Patch, extend or subclass an existing module where possible
142142
143143=end original
144144
145145可能であるのなら既存のモジュールにパッチ、拡張、
146146サブクラス化を行う
147147
148148=item *
149149
150150=begin original
151151
152152Do one thing and do it well
153153
154154=end original
155155
156156一つのことをうまくやる
157157
158158=item *
159159
160160=begin original
161161
162162Choose an appropriate name
163163
164164=end original
165165
166166ふさわしい名前を選ぶ
167167
168168=back
169169
170170=head2 The API
171171
172172(API)
173173
174174=over 4
175175
176176=item *
177177
178178=begin original
179179
180180API should be understandable by the average programmer
181181
182182=end original
183183
184184API は平均的なプログラマが理解できるようにするべき
185185
186186=item *
187187
188188=begin original
189189
190190Simple methods for simple tasks
191191
192192=end original
193193
194194簡単なタスクのための簡単なメソッドを
195195
196196=item *
197197
198198=begin original
199199
200200Separate functionality from output
201201
202202=end original
203203
204204機能を出力から分離する
205205
206206=item *
207207
208208=begin original
209209
210210Consistent naming of subroutines or methods
211211
212212=end original
213213
214214関数やメソッドには一貫性のある名前を付ける
215215
216216=item *
217217
218218=begin original
219219
220220Use named parameters (a hash or hashref) when there are more than two
221221parameters
222222
223223=end original
224224
225225二つ以上の引数ををとるのなら
226226名前付きの引数(ハッシュまたはハッシュリファレンス)を使う
227227
228228=back
229229
230230=head2 Stability
231231
232232(安定性)
233233
234234=over 4
235235
236236=item *
237237
238238=begin original
239239
240240Ensure your module works under C<use strict> and C<-w>
241241
242242=end original
243243
244244C<use strict> 及び C<-w> の環境下で動作することを
245245保証する
246246
247247=item *
248248
249249=begin original
250250
251251Stable modules should maintain backwards compatibility
252252
253253=end original
254254
255255安定したモジュールは後方互換性を維持するべき
256256
257257=back
258258
259259=head2 Documentation
260260
261261(ドキュメンテーション)
262262
263263=over 4
264264
265265=item *
266266
267267=begin original
268268
269269Write documentation in POD
270270
271271=end original
272272
273273文書を POD 形式で書く
274274
275275=item *
276276
277277=begin original
278278
279279Document purpose, scope and target applications
280280
281281=end original
282282
283283目的、範囲、及び対象となるアプリケーションを記述する
284284
285285=item *
286286
287287=begin original
288288
289289Document each publically accessible method or subroutine, including params and return values
290290
291291=end original
292292
293293個々の公開されているアクセスメソッドまたは関数を、
294294引数及び返り値も含めて記述する
295295
296296=item *
297297
298298=begin original
299299
300300Give examples of use in your documentation
301301
302302=end original
303303
304304文書に使い方を例示する
305305
306306=item *
307307
308308=begin original
309309
310310Provide a README file and perhaps also release notes, changelog, etc
311311
312312=end original
313313
314314README ファイルを提供する; またできればリリースノート、更新履歴も
315315
316316=item *
317317
318318=begin original
319319
320320Provide links to further information (URL, email)
321321
322322=end original
323323
324324さらなる情報へのリンク(URL, email)を提供する
325325
326326=back
327327
328328=head2 Release considerations
329329
330330(リリース時に確認すること)
331331
332332=over 4
333333
334334=item *
335335
336336=begin original
337337
338338Specify pre-requisites in Makefile.PL or Build.PL
339339
340340=end original
341341
342342Makefile.PL または Build.PL に依存(pre-requisites)を記述する
343343
344344=item *
345345
346346=begin original
347347
348348Specify Perl version requirements with C<use>
349349
350350=end original
351351
352352動作に必要な Perl のバージョンを C<use> で記述する
353353
354354=item *
355355
356356=begin original
357357
358358Include tests with your module
359359
360360=end original
361361
362362モジュールにはテストを含める
363363
364364=item *
365365
366366=begin original
367367
368368Choose a sensible and consistent version numbering scheme (X.YY is the common Perl module numbering scheme)
369369
370370=end original
371371
372372バージョン番号の採番には一般的で矛盾の起きない形式を選ぶ
373373(Perl モジュールでは一般的に X.YY が使われている)
374374
375375=item *
376376
377377=begin original
378378
379379Increment the version number for every change, no matter how small
380380
381381=end original
382382
383383たとえそれがどんなに小さな変更であっても、変更毎にバージョン番号を増やす
384384
385385=item *
386386
387387=begin original
388388
389389Package the module using "make dist"
390390
391391=end original
392392
393393モジュールのパッケージングには "make dist" を使う
394394
395395=item *
396396
397397=begin original
398398
399399Choose an appropriate license (GPL/Artistic is a good default)
400400
401401=end original
402402
403403適切なライセンスを選ぶ (GPL/Artistic はよいデフォルトです)
404404
405405=back
406406
407407=head1 BEFORE YOU START WRITING A MODULE
408408
409409(モジュールを書き始める前に)
410410
411411=begin original
412412
413413Try not to launch headlong into developing your module without spending
414414some time thinking first. A little forethought may save you a vast
415415amount of effort later on.
416416
417417=end original
418418
419419最初に少し考える時間を取らずにモジュール開発に取りかかろうとしないで
420420ください。
421421予め少し考えておくことで、後での多くの苦労を防げます。
422422
423423=head2 Has it been done before?
424424
425425(以前作られていなかった?)
426426
427427=begin original
428428
429429You may not even need to write the module. Check whether it's already
430430been done in Perl, and avoid re-inventing the wheel unless you have a
431431good reason.
432432
433433=end original
434434
435435そもそもモジュールを書く必要がないかもしれません。
436436既に Perl で行われているかどうかを調べて、よい理由がない限り
437437車輪の再発明は避けてください。
438438
439439=begin original
440440
441441Good places to look for pre-existing modules include
442442http://search.cpan.org/ and asking on modules@perl.org
443443
444444=end original
445445
446446既にあるモジュールを探すのによい場所は、http://search.cpan.org/ と、
447447modules@perl.org に聞くことです。
448448
449449=begin original
450450
451451If an existing module B<almost> does what you want, consider writing a
452452patch, writing a subclass, or otherwise extending the existing module
453453rather than rewriting it.
454454
455455=end original
456456
457457もし既にあるモジュールがやりたいことを B<ほとんど> しているなら、
458458それを書き直すのではなく、パッチを作ったり、派生クラスを作ったり、
459459あるいは既にあるモジュールを拡張するためのその他の手段を考慮してください。
460460
461461=head2 Do one thing and do it well
462462
463463(一つのことをうまくやる)
464464
465465=begin original
466466
467467At the risk of stating the obvious, modules are intended to be modular.
468468A Perl developer should be able to use modules to put together the
469469building blocks of their application. However, it's important that the
470470blocks are the right shape, and that the developer shouldn't have to use
471471a big block when all they need is a small one.
472472
473473=end original
474474
475475当たり前のことを述べるという危険を冒しますが、モジュールはモジュール式で
476476あることを目的としています。
477477Perl 開発者は、自身のアプリケーションの建築ブロックを寄せ集めるために
478478モジュールを使えるようにするべきです。
479479しかし、ブロックが正しい形をしていて、開発者が小さいブロックが必要な
480480だけのときに大きいブロックを使う必要がないようにすることが重要です。
481481
482482=begin original
483483
484484Your module should have a clearly defined scope which is no longer than
485485a single sentence. Can your module be broken down into a family of
486486related modules?
487487
488488=end original
489489
490490モジュールは、一文だけで表現できる明確に定義されたスコープを持つべきです。
491491あなたのモジュールは関係するモジュール群に分割できませんか?
492492
493493=begin original
494494
495495Bad example:
496496
497497=end original
498498
499499悪い例:
500500
501501=begin original
502502
503503"FooBar.pm provides an implementation of the FOO protocol and the
504504related BAR standard."
505505
506506=end original
507507
508508「FooBar.pm は、FOO プロトコルと、関連する BAR 標準の実装を提供します。」
509509
510510=begin original
511511
512512Good example:
513513
514514=end original
515515
516516良い例:
517517
518518=begin original
519519
520520"Foo.pm provides an implementation of the FOO protocol. Bar.pm
521521implements the related BAR protocol."
522522
523523=end original
524524
525525「Foo.pm は FOO プロトコルの実装を提供します。
526526Bar.pm は関連する BAR プロトコルを実装します。」
527527
528528=begin original
529529
530530This means that if a developer only needs a module for the BAR standard,
531531they should not be forced to install libraries for FOO as well.
532532
533533=end original
534534
535535これは、もし開発者が BAR 標準のモジュールだけを必要としているなら、
536536FOO ライブラリのインストールを強制されないということです。
537537
538538=head2 What's in a name?
539539
540540(なんて名前?)
541541
542542=begin original
543543
544544Make sure you choose an appropriate name for your module early on. This
545545will help people find and remember your module, and make programming
546546with your module more intuitive.
547547
548548=end original
549549
550550前もって、モジュールのための適切な名前を選んでください。
551551これは人々がモジュールを探したり覚えたりする助けになり、モジュールを
552552使ったプログラミングがより直観的になります。
553553
554554=begin original
555555
556556When naming your module, consider the following:
557557
558558=end original
559559
560560モジュールに名前を付けるときには、以下のことを考慮してください:
561561
562562=over 4
563563
564564=item *
565565
566566=begin original
567567
568568Be descriptive (i.e. accurately describes the purpose of the module).
569569
570570=end original
571571
572572説明的にする (モジュールの目的を正確に表現する)。
573573
574574=item *
575575
576576=begin original
577577
578578Be consistent with existing modules.
579579
580580=end original
581581
582582すでにあるモジュールと一貫性をもつ。
583583
584584=item *
585585
586586=begin original
587587
588588Reflect the functionality of the module, not the implementation.
589589
590590=end original
591591
592592モジュールの実装ではなく、モジュールの機能を反映させる。
593593
594594=item *
595595
596596=begin original
597597
598598Avoid starting a new top-level hierarchy, especially if a suitable
599599hierarchy already exists under which you could place your module.
600600
601601=end original
602602
603603新しいトップレベル階層を作るのを避ける(特にモジュールを置くのに
604604適切な階層がすでにある場合は)。
605605
606606=back
607607
608608=begin original
609609
610610You should contact modules@perl.org to ask them about your module name
611611before publishing your module. You should also try to ask people who
612612are already familiar with the module's application domain and the CPAN
613613naming system. Authors of similar modules, or modules with similar
614614names, may be a good place to start.
615615
616616=end original
617617
618618モジュールを出版する前に、モジュール名について訊ねるために
619619modules@perl.org に連絡するべきです。
620620また、すでにモジュールのアプリケーションドメインと CPAN 命名システムに
621621親しんでいる人々に尋ねてみるべきです。
622622同様なモジュールの作者や、似た名前のモジュールは始めるのに
623623いいところでしょう。
624624
625625=head1 DESIGNING AND WRITING YOUR MODULE
626626
627627(モジュールの設計と作成)
628628
629629=begin original
630630
631631Considerations for module design and coding:
632632
633633=end original
634634
635635モジュールの設計とコーディングで考慮すること:
636636
637637=head2 To OO or not to OO?
638638
639639(OO か非 OO か?)
640640
641641=begin original
642642
643643Your module may be object oriented (OO) or not, or it may have both kinds
644644of interfaces available. There are pros and cons of each technique, which
645645should be considered when you design your API.
646646
647647=end original
648648
649649モジュールはオブジェクト指向 (OO) にするかしないか、あるいは両方の
650650インターフェースを持つようにもできます。
651651それぞれの技術には、API を設計するときに検討するべき
652652メリットデメリットがあります。
653653
654654=begin original
655655
656656In I<Perl Best Practices> (copyright 2004, Published by O'Reilly Media, Inc.),
657657Damian Conway provides a list of criteria to use when deciding if OO is the
658658right fit for your problem:
659659
660660=end original
661661
662662I<Perl ベストプラクティス>(Perl Best Practices>) (2004 年、
663663オライリーメディアによって出版)で、Damian Conway は OO が問題を解決するのに
664664向いているかを判断するときに使う基準の一覧を提供しています:
665665
666666=over 4
667667
668=item *
668=item *
669669
670670=begin original
671671
672672The system being designed is large, or is likely to become large.
673673
674674=end original
675675
676676システムが大きかったり大きくなりそう。
677677
678=item *
678=item *
679679
680680=begin original
681681
682682The data can be aggregated into obvious structures, especially if
683683there's a large amount of data in each aggregate.
684684
685685=end original
686686
687687データが、オブジェクトになるよくある構造に集約される; 特にそれぞれの集約が
688688大量のデータである。
689689
690=item *
690=item *
691691
692692=begin original
693693
694694The various types of data aggregate form a natural hierarchy that
695695facilitates the use of inheritance and polymorphism.
696696
697697=end original
698698
699699データ形式が継承や多態性を容易にするような自然な階層を形成している。
700700
701701=item *
702702
703703=begin original
704704
705705You have a piece of data on which many different operations are
706706applied.
707707
708708=end original
709709
710710様々な異なる操作が行われるデータがある。
711711
712712=item *
713713
714714=begin original
715715
716716You need to perform the same general operations on related types of
717717data, but with slight variations depending on the specific type of data
718718the operations are applied to.
719719
720720=end original
721721
722722データの型に関係する同じ一般的な操作をする必要があるけれども、操作を
723723適用するデータの型によって少しずつ異なる。
724724
725725=item *
726726
727727=begin original
728728
729729It's likely you'll have to add new data types later.
730730
731731=end original
732732
733733後で新しいデータ型を追加する必要がありそう。
734734
735735=item *
736736
737737=begin original
738738
739739The typical interactions between pieces of data are best represented by
740740operators.
741741
742742=end original
743743
744744データとの典型的な相互作用が演算子によって最もよく表現される。
745745
746746=item *
747747
748748=begin original
749749
750750The implementation of individual components of the system is likely to
751751change over time.
752752
753753=end original
754754
755755システムの個々の要素の実装が後でやがて変更になりそう。
756756
757757=item *
758758
759759=begin original
760760
761761The system design is already object-oriented.
762762
763763=end original
764764
765765システム設計自身が既にオブジェクト指向である。
766766
767767=item *
768768
769769=begin original
770770
771771Large numbers of other programmers will be using your code modules.
772772
773773=end original
774774
775775大量のクライアントコードがこのソフトウェアを使う (そして実装から変更を
776776分離しておくべき) とき
777777
778778=back
779779
780780=begin original
781781
782782Think carefully about whether OO is appropriate for your module.
783783Gratuitous object orientation results in complex APIs which are
784784difficult for the average module user to understand or use.
785785
786786=end original
787787
788788あなたのモジュールに OO が適切かどうかを慎重に考えてください。
789789不必要なオブジェクト指向は、平均的なモジュール利用者が理解や使用するのが
790790困難な複雑な API となります。
791791
792792=head2 Designing your API
793793
794794(API の設計)
795795
796796=begin original
797797
798798Your interfaces should be understandable by an average Perl programmer.
799799The following guidelines may help you judge whether your API is
800800sufficiently straightforward:
801801
802802=end original
803803
804804インターフェースは平均的な Perl プログラマが理解可能であるべきです。
805805以下のガイドラインは、API が充分に簡単かどうかを判断する手助けに
806806なるでしょう:
807807
808808=over 4
809809
810810=item Write simple routines to do simple things.
811811
812812(単純なことをする単純なルーチンを書く。)
813813
814814=begin original
815815
816816It's better to have numerous simple routines than a few monolithic ones.
817817If your routine changes its behaviour significantly based on its
818818arguments, it's a sign that you should have two (or more) separate
819819routines.
820820
821821=end original
822822
823823少量の巨大なルーチンよりも、たくさんの単純なルーチンの方がよいです。
824824ルーチンが引数によって大きく振る舞いを変えるなら、複数のルーチンに
825825分割するべきと言うサインです。
826826
827827=item Separate functionality from output.
828828
829829(機能を出力から分離する。)
830830
831831=begin original
832832
833833Return your results in the most generic form possible and allow the user
834834to choose how to use them. The most generic form possible is usually a
835835Perl data structure which can then be used to generate a text report,
836836HTML, XML, a database query, or whatever else your users require.
837837
838838=end original
839839
840840結果は出来るだけ一般的な形式で返して、ユーザがそれをどのように使うかを
841841選択できるようにします。
842842最も一般的な形式とは、おそらく後でテキストレポート、HTML、XML、
843843データベースクエリ、あるいはユーザが求めるもの何でも生成できる
844844Perl データ構造です。
845845
846846=begin original
847847
848848If your routine iterates through some kind of list (such as a list of
849849files, or records in a database) you may consider providing a callback
850850so that users can manipulate each element of the list in turn.
851851File::Find provides an example of this with its
852852C<find(\&wanted, $dir)> syntax.
853853
854854=end original
855855
856856あなたのルーチンがある種のリスト(ファイルのリスト、データベースの
857857レコードなど)に対して反復するなら、ユーザがリストのそれぞれの要素を
858858操作できるようなコールバックを提供することを考慮してください。
859859File::Find は C<find(\&wanted, $dir)> という文法で、この場合の例を
860860提供しています。
861861
862862=item Provide sensible shortcuts and defaults.
863863
864864(実用的なショートカットやデフォルトを提供する。)
865865
866866=begin original
867867
868868Don't require every module user to jump through the same hoops to achieve a
869869simple result. You can always include optional parameters or routines for
870870more complex or non-standard behaviour. If most of your users have to
871871type a few almost identical lines of code when they start using your
872872module, it's a sign that you should have made that behaviour a default.
873873Another good indicator that you should use defaults is if most of your
874874users call your routines with the same arguments.
875875
876876=end original
877877
878878単純な結果を得るために全てのモジュールユーザに同じ輪をくぐることを
879879要求しないようにしてください。
880880より複雑だったり標準でない振る舞いのためには、常にオプションの引数や
881881ルーチンを用意して管浅い。
882882もしほとんどのユーザがモジュールを使い始めるときにほとんど同じ
883883数行のコードを書く必要があるなら、それはその振る舞いをデフォルトに
884884するべきというサインです。
885885デフォルトを使うべきというもう一つの指標は、ユーザのほとんどが同じ引数で
886886ルーチンを呼び出すときです。
887887
888888=item Naming conventions
889889
890890(命名規則)
891891
892892=begin original
893893
894894Your naming should be consistent. For instance, it's better to have:
895895
896896=end original
897897
898898命名は一貫性を持たせるべきです。
899899例えば、以下のものは:
900900
901901 display_day();
902902 display_week();
903903 display_year();
904904
905905=begin original
906906
907907than
908908
909909=end original
910910
911911以下のものよりよいです:
912912
913913 display_day();
914914 week_display();
915915 show_year();
916916
917917=begin original
918918
919919This applies equally to method names, parameter names, and anything else
920920which is visible to the user (and most things that aren't!)
921921
922922=end original
923923
924924これはメソッド名、引数名、その他ユーザに見えるもの何にでも
925925(そして見えない物のほとんどにも!)適用されます。
926926
927927=item Parameter passing
928928
929929(引数の渡し方)
930930
931931=begin original
932932
933933Use named parameters. It's easier to use a hash like this:
934934
935935=end original
936936
937937名前付き引数を使いましょう。
938938これは以下のようにハッシュを使えば:
939939
940940 $obj->do_something(
941941 name => "wibble",
942942 type => "text",
943943 size => 1024,
944944 );
945945
946946=begin original
947947
948948... than to have a long list of unnamed parameters like this:
949949
950950=end original
951951
952952…以下のように名前のない引数の長いリストより簡単です:
953953
954954 $obj->do_something("wibble", "text", 1024);
955955
956956=begin original
957957
958958While the list of arguments might work fine for one, two or even three
959959arguments, any more arguments become hard for the module user to
960960remember, and hard for the module author to manage. If you want to add
961961a new parameter you will have to add it to the end of the list for
962962backward compatibility, and this will probably make your list order
963963unintuitive. Also, if many elements may be undefined you may see the
964964following unattractive method calls:
965965
966966=end original
967967
968968引数のリストは 1 引数、2 引数、そして 3 引数でもうまく動作するでしょうが、
969969それ以上になるとモジュールユーザが覚えるのが難しくなり、モジュール
970970作者が管理するのも難しくなります。
971971新しい引数を追加したいときは、後方互換性のためにリストの最後に追加する
972972必要があり、そしてこれによっておそらくリストの順序が直観的では
973973なくなるでしょう。
974974また、多くの要素が未定義の場合、以下のような美しくないメソッド呼び出しを
975975見ることになるでしょう:
976976
977 $obj->do_something(undef, undef, undef, undef, undef, 1024);
977 $obj->do_something(undef, undef, undef, undef, undef, undef, 1024);
978978
979979=begin original
980980
981981Provide sensible defaults for parameters which have them. Don't make
982982your users specify parameters which will almost always be the same.
983983
984984=end original
985985
986986引数に、意味のあるデフォルトがあるならそれをデフォルトにしましょう。
987987ユーザーに、毎回ほとんど同じような引数を指定させてはいけません。
988988
989989=begin original
990990
991991The issue of whether to pass the arguments in a hash or a hashref is
992992largely a matter of personal style.
993993
994994=end original
995995
996996引数をハッシュで渡すかハッシュリファレンスで渡すかの問題は主に個人的な
997997スタイルの問題です。
998998
999999=begin original
10001000
10011001The use of hash keys starting with a hyphen (C<-name>) or entirely in
10021002upper case (C<NAME>) is a relic of older versions of Perl in which
10031003ordinary lower case strings were not handled correctly by the C<=E<gt>>
10041004operator. While some modules retain uppercase or hyphenated argument
10051005keys for historical reasons or as a matter of personal style, most new
10061006modules should use simple lower case keys. Whatever you choose, be
10071007consistent!
10081008
10091009=end original
10101010
10111011ハイフンで始まるハッシュキー (C<-name>) や全て大文字のハッシュキー
10121012(C<NAME>) は、普通の小文字の文字列が C<=E<gt>> 演算子で扱えなかった
10131013古いバージョンの Perl の遺物です。
10141014一部のモジュールでは歴史的な理由や個人的なスタイルの問題で大文字や
10151015ハイフン付きのキーのままですが、ほとんどの新しいモジュールは単純な
10161016小文字のキーを使うべきです。
10171017どちらを選ぶにせよ、一貫性を持ちましょう!
10181018
10191019=back
10201020
10211021=head2 Strictness and warnings
10221022
10231023(strict と warnings)
10241024
10251025=begin original
10261026
10271027Your module should run successfully under the strict pragma and should
10281028run without generating any warnings. Your module should also handle
10291029taint-checking where appropriate, though this can cause difficulties in
10301030many cases.
10311031
10321032=end original
10331033
10341034モジュールは stirct プラグマ付きでも正しく動作し、一切の警告なしで
10351035動作するべきです。
10361036また、適切な場所では汚染チェックも扱うべきですが、これは多くの場合で困難を
10371037伴います。
10381038
10391039=head2 Backwards compatibility
10401040
10411041(後方互換性)
10421042
10431043=begin original
10441044
10451045Modules which are "stable" should not break backwards compatibility
10461046without at least a long transition phase and a major change in version
10471047number.
10481048
10491049=end original
10501050
10511051「安定版の」モジュールは、少なくとも長い移行フェーズとバージョン番号の
10521052メジャー番号の変更することなく、後方互換性を壊すべきではありません。
10531053
10541054=head2 Error handling and messages
10551055
10561056(エラーハンドリングとメッセージ)
10571057
10581058=begin original
10591059
10601060When your module encounters an error it should do one or more of:
10611061
10621062=end original
10631063
10641064モジュールがエラーに遭遇した場合、以下の一つあるいは複数を行うべきです:
10651065
10661066=over 4
10671067
10681068=item *
10691069
10701070=begin original
10711071
10721072Return an undefined value.
10731073
10741074=end original
10751075
10761076未定義値を返す。
10771077
10781078=item *
10791079
10801080=begin original
10811081
10821082set C<$Module::errstr> or similar (C<errstr> is a common name used by
10831083DBI and other popular modules; if you choose something else, be sure to
10841084document it clearly).
10851085
10861086=end original
10871087
10881088C<$Module::errstr> あるいは同様のものを設定する (C<errstr> は DBI および
10891089その他の有名なモジュールで使われている一般的な名前です; もし他のものを
10901090選んだなら、それを明確に文書化しておきましょう)。
10911091
10921092=item *
10931093
10941094=begin original
10951095
10961096C<warn()> or C<carp()> a message to STDERR.
10971097
10981098=end original
10991099
11001100C<warn()> や C<carp()> を使ってメッセージを STDERR に出力する。
11011101
11021102=item *
11031103
11041104=begin original
11051105
11061106C<croak()> only when your module absolutely cannot figure out what to
11071107do. (C<croak()> is a better version of C<die()> for use within
11081108modules, which reports its errors from the perspective of the caller.
11091109See L<Carp> for details of C<croak()>, C<carp()> and other useful
11101110routines.)
11111111
11121112=end original
11131113
11141114C<croak()> は、あなたのモジュールが何をすればいいのか全く分からないときにのみ
11151115使います。
11161116(C<croak()> はモジュール内で使うための C<die()> の改良版で、
11171117エラーを呼び出し元の観点から報告します。
11181118C<croak()>, C<carp()> およびその他の便利なルーチンについては
11191119L<Carp> を参照してください。)
11201120
11211121=item *
11221122
11231123=begin original
11241124
11251125As an alternative to the above, you may prefer to throw exceptions using
11261126the Error module.
11271127
11281128=end original
11291129
11301130上述の代替案として、Error モジュールを使って例外を投げる方を
11311131好むかもしれません。
11321132
11331133=back
11341134
11351135=begin original
11361136
11371137Configurable error handling can be very useful to your users. Consider
11381138offering a choice of levels for warning and debug messages, an option to
11391139send messages to a separate file, a way to specify an error-handling
11401140routine, or other such features. Be sure to default all these options
11411141to the commonest use.
11421142
11431143=end original
11441144
11451145設定可能なエラー処理はユーザーにとってとても便利です。
11461146警告やデバッグメッセージのレベルの選択、メッセージの別のファイルへの書き出し、
11471147エラー処理ルーチンの指定方法、あるいはその他の同様の機能の提供を
11481148考慮してください。
11491149これらのオプション全てのデフォルトは最も一般的な使用法に設定してください。
11501150
11511151=head1 DOCUMENTING YOUR MODULE
11521152
11531153(モジュールを文書化する)
11541154
11551155=head2 POD
11561156
11571157=begin original
11581158
11591159Your module should include documentation aimed at Perl developers.
11601160You should use Perl's "plain old documentation" (POD) for your general
11611161technical documentation, though you may wish to write additional
11621162documentation (white papers, tutorials, etc) in some other format.
11631163You need to cover the following subjects:
11641164
11651165=end original
11661166
11671167モジュールは Perl の開発者向けの文書を含めるべきです。
11681168一般的な技術文書に対しては Perl の "plain old documentation" (POD) を
11691169使うべきですが、追加の文書 (ホワイトペーパー、チュートリアルなど) は
11701170その他のフォーマットで書きたいかもしれません。
11711171以下のような主題に対応する必要があります:
11721172
11731173=over 4
11741174
11751175=item *
11761176
11771177=begin original
11781178
11791179A synopsis of the common uses of the module
11801180
11811181=end original
11821182
11831183モジュールの一般的な使い方の概要
11841184
11851185=item *
11861186
11871187=begin original
11881188
11891189The purpose, scope and target applications of your module
11901190
11911191=end original
11921192
11931193モジュールの目的、スコープ、対象アプリケーション
11941194
11951195=item *
11961196
11971197=begin original
11981198
11991199Use of each publically accessible method or subroutine, including
12001200parameters and return values
12011201
12021202=end original
12031203
12041204(引数と返り値を含む) 公開されているメソッドやサブルーチンの使用法
12051205
12061206=item *
12071207
12081208=begin original
12091209
12101210Examples of use
12111211
12121212=end original
12131213
12141214使用例
12151215
12161216=item *
12171217
12181218=begin original
12191219
12201220Sources of further information
12211221
12221222=end original
12231223
12241224さらなる情報の情報源
12251225
12261226=item *
12271227
12281228=begin original
12291229
12301230A contact email address for the author/maintainer
12311231
12321232=end original
12331233
12341234作者/メンテナへ連絡するための email アドレス
12351235
12361236=back
12371237
12381238=begin original
12391239
12401240The level of detail in Perl module documentation generally goes from
12411241less detailed to more detailed. Your SYNOPSIS section should contain a
12421242minimal example of use (perhaps as little as one line of code; skip the
12431243unusual use cases or anything not needed by most users); the
12441244DESCRIPTION should describe your module in broad terms, generally in
12451245just a few paragraphs; more detail of the module's routines or methods,
12461246lengthy code examples, or other in-depth material should be given in
12471247subsequent sections.
12481248
12491249=end original
12501250
12511251Perl モジュール文書の詳細度は、一般的に概略から詳細へという順序に
12521252なっています。
12531253SYNOPSIS 節には使うための最小限の例を含むべきです
12541254(おそらくは一行でしょう; 一般的でない使い方やほとんどのユーザーにとって
12551255必要でないものは省略します);
12561256DESCRIPTION はモジュールを広義で記述し、一般的には単に数段落です;
12571257モジュールのルーチンやメソッドに関する更なる詳細、長いコード例、その他の
12581258より深い内容は引き続く節に書くべきです。
12591259
12601260=begin original
12611261
12621262Ideally, someone who's slightly familiar with your module should be able
12631263to refresh their memory without hitting "page down". As your reader
12641264continues through the document, they should receive a progressively
12651265greater amount of knowledge.
12661266
12671267=end original
12681268
12691269理想的には、モジュールに対して少しなじみのあるユーザーなら "page down" キーを
12701270押すことなく記憶を思い出せるようにするべきです。
12711271読者が文書を読み進めるにつれて、徐々に多くの量の知識を受け取ります。
12721272
12731273=begin original
12741274
12751275The recommended order of sections in Perl module documentation is:
12761276
12771277=end original
12781278
12791279推奨する Perl モジュール文書の章の順序は:
12801280
12811281=over 4
12821282
12831283=item *
12841284
12851285NAME
12861286
12871287=item *
12881288
12891289SYNOPSIS
12901290
12911291=item *
12921292
12931293DESCRIPTION
12941294
12951295=item *
12961296
12971297=begin original
12981298
12991299One or more sections or subsections giving greater detail of available
13001300methods and routines and any other relevant information.
13011301
13021302=end original
13031303
13041304利用可能なメソッドやルーチンのより詳細と、その他の関係する情報のための
13051305一つまたは複数の節。
13061306
13071307=item *
13081308
13091309=begin original
13101310
13111311BUGS/CAVEATS/etc
13121312
13131313=end original
13141314
13151315BUGS/CAVEATS など
13161316
13171317=item *
13181318
13191319AUTHOR
13201320
13211321=item *
13221322
13231323SEE ALSO
13241324
13251325=item *
13261326
13271327=begin original
13281328
13291329COPYRIGHT and LICENSE
13301330
13311331=end original
13321332
13331333COPYRIGHT と LICENSE
13341334
13351335=back
13361336
13371337=begin original
13381338
13391339Keep your documentation near the code it documents ("inline"
13401340documentation). Include POD for a given method right above that
13411341method's subroutine. This makes it easier to keep the documentation up
13421342to date, and avoids having to document each piece of code twice (once in
13431343POD and once in comments).
13441344
13451345=end original
13461346
13471347文書は、記述しているコードの近くになるように(「インライン」文書)
13481348維持してください。
13491349メソッドのための POD はメソッドのサブルーチンの直前に書いてください。
13501350これにより文書を最新に保つのが容易になり、一つのコードに対して 2 箇所
13511351(POD とコメント) に書く必要がなくなります。
13521352
13531353=head2 README, INSTALL, release notes, changelogs
13541354
13551355(README, INSTALL, リリースノート, changelogs)
13561356
13571357=begin original
13581358
13591359Your module should also include a README file describing the module and
13601360giving pointers to further information (website, author email).
13611361
13621362=end original
13631363
13641364モジュールには、モジュールの説明と、さらなる情報へのポインタ (ウェブサイト、
13651365作者への email) を記述した README ファイルも含めるべきです。
13661366
13671367=begin original
13681368
13691369An INSTALL file should be included, and should contain simple installation
13701370instructions. When using ExtUtils::MakeMaker this will usually be:
13711371
13721372=end original
13731373
13741374INSTALL ファイルを含めて、そこに簡単なインストール手順を記述するべきです。
13751375ExtUtils::MakeMaker を使っているなら、これは普通は以下のようになります:
13761376
13771377=over 4
13781378
13791379=item perl Makefile.PL
13801380
13811381=item make
13821382
13831383=item make test
13841384
13851385=item make install
13861386
13871387=back
13881388
13891389=begin original
13901390
13911391When using Module::Build, this will usually be:
13921392
13931393=end original
13941394
13951395Module::Build を使っているなら、これは普通は以下のようになります:
13961396
13971397=over 4
13981398
13991399=item perl Build.PL
14001400
14011401=item perl Build
14021402
14031403=item perl Build test
14041404
14051405=item perl Build install
14061406
14071407=back
14081408
14091409=begin original
14101410
14111411Release notes or changelogs should be produced for each release of your
14121412software describing user-visible changes to your module, in terms
14131413relevant to the user.
14141414
14151415=end original
14161416
14171417リリースノートまたは changelogs は、ユーザーからの観点でモジュールの
14181418ユーザーから見える変更点を記述して、リリース毎に作成するべきです。
1419
1420=begin original
1421
1422Unless you have good reasons for using some other format
1423(for example, a format used within your company),
1424the convention is to name your changelog file C<Changes>,
1425and to follow the simple format described in L<CPAN::Changes::Spec>.
1426
1427=end original
1428
1429他の形式を使う良い理由 (例えば、会社で使われている形式) がない限り、
1430変更履歴ファイルは C<Changes> という名前にして、L<CPAN::Changes::Spec> に
1431ある単純な形式に従うのが慣習です。
14321419
14331420=head1 RELEASE CONSIDERATIONS
14341421
14351422=head2 Version numbering
14361423
14371424(バージョン番号)
14381425
14391426=begin original
14401427
14411428Version numbers should indicate at least major and minor releases, and
14421429possibly sub-minor releases. A major release is one in which most of
14431430the functionality has changed, or in which major new functionality is
14441431added. A minor release is one in which a small amount of functionality
14451432has been added or changed. Sub-minor version numbers are usually used
14461433for changes which do not affect functionality, such as documentation
14471434patches.
14481435
14491436=end original
14501437
14511438バージョン番号は少なくともメジャーリリースとマイナーリリース、そして
14521439場合により副マイナーリリースを示すべきです。
14531440メジャーリリースは、主な機能の変更や、あるいは主な新機能が
14541441追加です。
14551442マイナーリリースは機能の一部の追加や修正です。
14561443副マイナーバージョン番号は普通、文書パッチのような機能に影響を与えない
14571444変更に使われます。
14581445
14591446=begin original
14601447
14611448The most common CPAN version numbering scheme looks like this:
14621449
14631450=end original
14641451
14651452最も一般的な CPAN のバージョン番号付け方式は次のようなものです:
14661453
14671454 1.00, 1.10, 1.11, 1.20, 1.30, 1.31, 1.32
14681455
14691456=begin original
14701457
14711458A correct CPAN version number is a floating point number with at least
147214592 digits after the decimal. You can test whether it conforms to CPAN by
14731460using
14741461
14751462=end original
14761463
14771464正しい CPAN バージョン番号は、小数点の後に少なくとも 2 桁の数字がある
14781465浮動小数点数です。
14791466CPAN に準拠しているかどうかは以下のようにしてテストできます
14801467
14811468 perl -MExtUtils::MakeMaker -le 'print MM->parse_version(shift)' 'Foo.pm'
14821469
14831470=begin original
14841471
14851472If you want to release a 'beta' or 'alpha' version of a module but
14861473don't want CPAN.pm to list it as most recent use an '_' after the
14871474regular version number followed by at least 2 digits, eg. 1.20_01. If
14881475you do this, the following idiom is recommended:
14891476
14901477=end original
14911478
14921479「ベータ」あるいは「アルファ」バージョンのモジュールをリリースしたいけれども
14931480CPAN.pm に最新版として扱ってほしくない場合、通常のバージョン番号の
14941481後に '_' を使い、引き続いて最低 2 桁の数字を付けます; 例えば 1.20_01。
14951482こうするなら、以下の慣用句が推奨されます:
14961483
14971484 $VERSION = "1.12_01";
14981485 $XS_VERSION = $VERSION; # only needed if you have XS code
14991486 $VERSION = eval $VERSION;
15001487
15011488=begin original
15021489
15031490With that trick MakeMaker will only read the first line and thus read
15041491the underscore, while the perl interpreter will evaluate the $VERSION
15051492and convert the string into a number. Later operations that treat
15061493$VERSION as a number will then be able to do so without provoking a
15071494warning about $VERSION not being a number.
15081495
15091496=end original
15101497
15111498この小技を使うと、MakeMaker は最初の行だけを読むので下線付きで読み、
15121499一方 perl インタプリタは $VERSION を eval して文字列を数値に変換します。
15131500これにより、後の操作で $VERSION を数値として扱うものがあっても
15141501$VERSION が数値でないという警告が出なくなります。
15151502
15161503=begin original
15171504
15181505Never release anything (even a one-word documentation patch) without
15191506incrementing the number. Even a one-word documentation patch should
15201507result in a change in version at the sub-minor level.
15211508
15221509=end original
15231510
15241511(たとえ 1 文字の文書パッチでも)バージョン番号を増やすことなく何かを
15251512リリースしてはいけません。
152615131 文字の文書パッチであっても副マイナー番号を変更するべきです。
15271514
15281515=head2 Pre-requisites
15291516
15301517(依存)
15311518
15321519=begin original
15331520
15341521Module authors should carefully consider whether to rely on other
15351522modules, and which modules to rely on.
15361523
15371524=end original
15381525
15391526モジュール作者は、他のモジュールに依存するかどうか、どのモジュールに
15401527依存するかについて注意深く考慮するべきです。
15411528
15421529=begin original
15431530
15441531Most importantly, choose modules which are as stable as possible. In
15451532order of preference:
15461533
15471534=end original
15481535
15491536もっとも重要なこととして、できるだけ安定しているモジュールを選んでください。
15501537優先順位としては:
15511538
15521539=over 4
15531540
15541541=item *
15551542
15561543=begin original
15571544
15581545Core Perl modules
15591546
15601547=end original
15611548
15621549コア Perl モジュール
15631550
15641551=item *
15651552
15661553=begin original
15671554
15681555Stable CPAN modules
15691556
15701557=end original
15711558
15721559安定している CPAN モジュール
15731560
15741561=item *
15751562
15761563=begin original
15771564
15781565Unstable CPAN modules
15791566
15801567=end original
15811568
15821569不安定な CPAN モジュール
15831570
15841571=item *
15851572
15861573=begin original
15871574
15881575Modules not available from CPAN
15891576
15901577=end original
15911578
15921579CPAN から利用できないモジュール
15931580
15941581=back
15951582
15961583=begin original
15971584
15981585Specify version requirements for other Perl modules in the
15991586pre-requisites in your Makefile.PL or Build.PL.
16001587
16011588=end original
16021589
16031590Makefile.PL か Build.PL の pre-requisites に、他の Perl モジュールの
16041591必要バージョンを指定します。
16051592
16061593=begin original
16071594
16081595Be sure to specify Perl version requirements both in Makefile.PL or
16091596Build.PL and with C<require 5.6.1> or similar. See the section on
16101597C<use VERSION> of L<perlfunc/require> for details.
16111598
16121599=end original
16131600
16141601Makefile.PL や Build.PL と、C<require 5.6.1> のような形の両方で、
16151602Perl の必要バージョンを指定します。
16161603詳しくは L<perlfunc/require> の C<use VERSION> の節を参照してください。
16171604
16181605=head2 Testing
16191606
16201607(テスト)
16211608
16221609=begin original
16231610
16241611All modules should be tested before distribution (using "make disttest"),
16251612and the tests should also be available to people installing the modules
16261613(using "make test").
16271614For Module::Build you would use the C<make test> equivalent C<perl Build test>.
16281615
16291616=end original
16301617
16311618全てのモジュールは配布する前に ("make disttest" を使って)
16321619テストされるべきですし、テストはモジュールをインストールしようとしている
16331620人々によっても ("make test" を使って) 実行可能であるべきです。
16341621Module::Build の場合は C<make test> の等価物である C<perl Build test> を
16351622使います。
16361623
16371624=begin original
16381625
16391626The importance of these tests is proportional to the alleged stability of a
16401627module. A module which purports to be stable or which hopes to achieve wide
16411628use should adhere to as strict a testing regime as possible.
16421629
16431630=end original
16441631
16451632これらのテストの重要性はモジュールの安定性に比例します。
16461633安定していると表明したり、広く使われることを望むモジュールは、できるだけ
16471634厳密なテスト体制に固執するべきです。
16481635
16491636=begin original
16501637
16511638Useful modules to help you write tests (with minimum impact on your
16521639development process or your time) include Test::Simple, Carp::Assert
16531640and Test::Inline.
16541641For more sophisticated test suites there are Test::More and Test::MockObject.
16551642
16561643=end original
16571644
16581645(開発プロセスや時間に与える影響を最小限にするように) テストを書くのを助ける
16591646モジュールには Test::Simple, Carp::Assert, Test::Inline などがあります。
16601647さらに洗練されたテストスイートは Test::More と Test::MockObject です。
16611648
16621649=head2 Packaging
16631650
16641651(パッケージング)
16651652
16661653=begin original
16671654
16681655Modules should be packaged using one of the standard packaging tools.
16691656Currently you have the choice between ExtUtils::MakeMaker and the
16701657more platform independent Module::Build, allowing modules to be installed in a
16711658consistent manner.
16721659When using ExtUtils::MakeMaker, you can use "make dist" to create your
16731660package. Tools exist to help you to build your module in a MakeMaker-friendly
16741661style. These include ExtUtils::ModuleMaker and h2xs. See also L<perlnewmod>.
16751662
16761663=end original
16771664
16781665モジュールは標準的なパッケージングツールの一つを使って
16791666パッケージ化するべきです。
16801667現在のところ、ExtUtils::MakeMaker および、よりプラットフォーム独立で、
16811668一貫した方法でモジュールをインストールできる Module::Build という選択肢が
16821669あります。
16831670ExtUtils::MakeMaker を使うときは、パッケージを作るには "make dist" を
16841671使います。
16851672MakeMaker 風のスタイルでモジュールをビルドするのを助けるツールがあります。
16861673これらには ExtUtils::ModuleMaker や h2xs などがあります。
16871674L<perlnewmod> も参照してください。
16881675
16891676=head2 Licensing
16901677
16911678(ライセンス)
16921679
16931680=begin original
16941681
16951682Make sure that your module has a license, and that the full text of it
16961683is included in the distribution (unless it's a common one and the terms
16971684of the license don't require you to include it).
16981685
16991686=end original
17001687
17011688モジュールにはライセンスを付け、(そのライセンスが一般的なもので、
17021689そのライセンスがライセンスの全文を配布物に含めることを要求していないのでない
17031690限り)、その全文を配布に含めるようにしてください。
17041691
17051692=begin original
17061693
17071694If you don't know what license to use, dual licensing under the GPL
17081695and Artistic licenses (the same as Perl itself) is a good idea.
17091696See L<perlgpl> and L<perlartistic>.
17101697
17111698=end original
17121699
17131700もしどのライセンスを使えばいいかわからない場合は、GPL と
17141701Artistic licenses のデュアルライセンス (Perl 自身と同じ) にするというのが
17151702いい考えです。
17161703L<perlgpl> と L<perlartistic> を参照してください。
17171704
17181705=head1 COMMON PITFALLS
17191706
17201707(よくある落とし穴)
17211708
17221709=head2 Reinventing the wheel
17231710
17241711(車輪の再発明)
17251712
17261713=begin original
17271714
17281715There are certain application spaces which are already very, very well
17291716served by CPAN. One example is templating systems, another is date and
17301717time modules, and there are many more. While it is a rite of passage to
17311718write your own version of these things, please consider carefully
17321719whether the Perl world really needs you to publish it.
17331720
17341721=end original
17351722
17361723CPAN によって提供されている、すでにとてもとてもうまくいっている
17371724アプリケーション分野もあります。
17381725例としてはテンプレートシステムや日付と時間のためのモジュールであり、
17391726その他にもたくさんあります。
17401727これらのものの自分専用版を書くというのは通過儀礼ではありますが、
17411728あなたがそれを公開することを Perl の世界が本当に必要としているかどうかを
17421729慎重に検討してください。
17431730
17441731=head2 Trying to do too much
17451732
17461733(やりすぎ)
17471734
17481735=begin original
17491736
17501737Your module will be part of a developer's toolkit. It will not, in
17511738itself, form the B<entire> toolkit. It's tempting to add extra features
17521739until your code is a monolithic system rather than a set of modular
17531740building blocks.
17541741
17551742=end original
17561743
17571744あなたのモジュールは開発者のツールキットの一部です。
17581745ツールキット B<全体> ではありません。
17591746これはあなたのコードをモジュール化された建築ブロックではなく一枚岩のシステムに
17601747なるまで余分な機能を追加しようとする誘惑です。
17611748
17621749=head2 Inappropriate documentation
17631750
17641751(不適切な文書)
17651752
17661753=begin original
17671754
17681755Don't fall into the trap of writing for the wrong audience. Your
17691756primary audience is a reasonably experienced developer with at least
17701757a moderate understanding of your module's application domain, who's just
17711758downloaded your module and wants to start using it as quickly as possible.
17721759
17731760=end original
17741761
17751762間違った読者に向けて書くという罠に陥らないでください。
17761763主な読者は、少なくともモジュールの適用分野についてある程度の理解のある
17771764適度に経験を積んだ開発者で、単にモジュールをダウンロードして、できるだけ
17781765早く使い始めたいと思っている人々です。
17791766
17801767=begin original
17811768
17821769Tutorials, end-user documentation, research papers, FAQs etc are not
17831770appropriate in a module's main documentation. If you really want to
17841771write these, include them as sub-documents such as C<My::Module::Tutorial> or
17851772C<My::Module::FAQ> and provide a link in the SEE ALSO section of the
17861773main documentation.
17871774
17881775=end original
17891776
17901777チュートリアル、エンドユーザー向け文書、研究論文、FAQ などはモジュールの
17911778主文書としては不適切です。
17921779どうしてもこれらのものを書きたいなら、C<My::Module::Tutorial> や
17931780C<My::Module::FAQ> のような副文書として含めて、主文書の SEE ALSO 節に
17941781リンクをつけてください。
17951782
17961783=head1 SEE ALSO
17971784
17981785=over 4
17991786
18001787=item L<perlstyle>
18011788
18021789=begin original
18031790
18041791General Perl style guide
18051792
18061793=end original
18071794
18081795一般的な Perl スタイルガイド
18091796
18101797=item L<perlnewmod>
18111798
18121799=begin original
18131800
18141801How to create a new module
18151802
18161803=end original
18171804
18181805新しいモジュールの作り方
18191806
18201807=item L<perlpod>
18211808
18221809=begin original
18231810
18241811POD documentation
18251812
18261813=end original
18271814
18281815POD 文書
18291816
18301817=item L<podchecker>
18311818
18321819=begin original
18331820
18341821Verifies your POD's correctness
18351822
18361823=end original
18371824
18381825POD の正しさを検証する
18391826
18401827=item Packaging Tools
18411828
18421829(パッケージングツール)
18431830
18441831L<ExtUtils::MakeMaker>, L<Module::Build>
18451832
18461833=item Testing tools
18471834
18481835(テストツール)
18491836
18501837L<Test::Simple>, L<Test::Inline>, L<Carp::Assert>, L<Test::More>, L<Test::MockObject>
18511838
18521839=item http://pause.perl.org/
18531840
18541841=begin original
18551842
18561843Perl Authors Upload Server. Contains links to information for module
18571844authors.
18581845
18591846=end original
18601847
18611848Perl Authors Upload Server。
18621849モジュール作者のための情報へのリンクがあります。
18631850
18641851=item Any good book on software engineering
18651852
18661853(ソフトウェア工学に関する良い本はなんでも)
18671854
18681855=back
18691856
18701857=head1 AUTHOR
18711858
18721859Kirrily "Skud" Robert <skud@cpan.org>
18731860
18741861=begin meta
18751862
18761863Translate: 山科 氷魚 (YAMASHINA Hio) <hio@hio.jp> (5.10.0)
18771864Update: SHIRAKATA Kentaro <argrath@ub32.org> (5.10.1-)
18781865Status: completed
18791866
18801867=end meta