[perldocjp-cvs 1449] CVS update: docs/perl/5.10.1

Back to archive index

argra****@users***** argra****@users*****
2012年 5月 28日 (月) 22:15:53 JST


Index: docs/perl/5.10.1/perllexwarn.pod
diff -u docs/perl/5.10.1/perllexwarn.pod:1.4 docs/perl/5.10.1/perllexwarn.pod:1.5
--- docs/perl/5.10.1/perllexwarn.pod:1.4	Sun May 27 22:41:31 2012
+++ docs/perl/5.10.1/perllexwarn.pod	Mon May 28 22:15:53 2012
@@ -462,10 +462,9 @@
 
 =end original
 
-3 & 4 の組み合わせの効果により、it will allow code which uses
-the C<warnings> pragma to control the warning behavior of $^W-type
-code (using a C<local $^W=0>) if it really wants to, but not vice-versa.
-(TBT)
+3 & 4 の組み合わせの効果により、本当に警告したいときに $^W 型のコードの
+警告の振る舞いを (C<local $^W=0> を使って) 制御するために
+C<warnings> プラグマを使えますが、逆はできません。
 
 =head2 Category Hierarchy
 X<warning, categories>
@@ -770,13 +769,13 @@
 
 =end original
 
-The call to C<warnings::register> will create a new warnings category
-called "MyMod::abc", i.e. the new category name matches the current
-package name. The C<open> function in the module will display a warning
-message if it gets given a relative path as a parameter. This warnings
-will only be displayed if the code that uses C<MyMod::Abc> has actually
-enabled them with the C<warnings> pragma like below.
-(TBT)
+C<warnings::register> の呼び出しにより、"MyMod::abc" という名前の新しい
+警告カテゴリを作成します; つまり、新しいカテゴリ名は現在のパッケージ名に
+一致します。
+このモジュールの C<open> 関数は、引数として相対パスが与えられると
+警告メッセージを出力します。
+この警告は、C<MyMod::Abc> を使うコードが 以下のようにして
+C<warnings> によって有効にされた場合にのみ出力されます。
 
     use MyMod::Abc;
     use warnings 'MyMod::Abc';
@@ -791,10 +790,9 @@
 
 =end original
 
-It is also possible to test whether the pre-defined warnings categories are
-set in the calling module with the C<warnings::enabled> function. Consider
-this snippet of code:
-(TBT)
+また、C<warnings::enabled> 関数を使って、既に定義されているカテゴリが
+呼び出しモジュールで設定されているかどうかをテストすることも可能です。
+以下のコード片を考えます:
 
     package MyMod::Abc;
 
@@ -816,10 +814,9 @@
 
 =end original
 
-The function C<open> has been deprecated, so code has been included to
-display a warning message whenever the calling module has (at least) the
-"deprecated" warnings category enabled. Something like this, say.
-(TBT)
+C<open> 関数は非推奨なので、呼び出しモジュールで (少なくとも)
+"deprecated" 警告カテゴリが有効のとき警告を出力するコードが含まれています。
+つまりこんな感じです。
 
     use warnings 'deprecated';
     use MyMod::Abc;
@@ -835,11 +832,10 @@
 
 =end original
 
-Either the C<warnings::warn> or C<warnings::warnif> function should be
-used to actually display the warnings message. This is because they can
-make use of the feature that allows warnings to be escalated into fatal
-errors. So in this case
-(TBT)
+実際に警告メッセージを出力するには、C<warnings::warn> 関数と
+C<warnings::warnif> 関数のどちらかを使うべきです。
+これは、警告を致命的エラーに昇格させる機能を使えるようにするためです。
+それで、このような場合:
 
     use MyMod::Abc;
     use warnings FATAL => 'MyMod::Abc';
@@ -853,9 +849,7 @@
 
 =end original
 
-the C<warnings::warnif> function will detect this and die after
-displaying the warning message.
-(TBT)
+C<warnings::warnif> 関数はこれを検出して、警告を出力した後 die します。
 
 =begin original
 
@@ -866,11 +860,10 @@
 
 =end original
 
-The three warnings functions, C<warnings::warn>, C<warnings::warnif>
-and C<warnings::enabled> can optionally take an object reference in place
-of a category name. In this case the functions will use the class name
-of the object as the warnings category.
-(TBT)
+三つの警告関数 C<warnings::warn>, C<warnings::warnif>,
+C<warnings::enabled> は、オプションとしてカテゴリ名の代わりにオブジェクトの
+リファレンスをとることができます。
+この場合関数は警告カテゴリとしてオブジェクトのクラス名を使います。
 
 =begin original
 
@@ -931,9 +924,8 @@
 
 =end original
 
-The code below makes use of both modules, but it only enables warnings from 
-C<Derived>.
-(TBT)
+以下のコードは両方のモジュールを使っていますが、C<Derived> からの警告だけを
+有効にしています。
 
     use Original;
     use Derived;
@@ -950,9 +942,8 @@
 
 =end original
 
-When this code is run only the C<Derived> object, C<$b>, will generate
-a warning. 
-(TBT)
+このコードが C<Derived> オブジェクトからのみ実行されているとき、
+C<$b> は警告を出力します。
 
     Odd numbers are unsaf****@main***** line 7
 
@@ -963,9 +954,7 @@
 
 =end original
 
-Notice also that the warning is reported at the line where the object is first
-used.
-(TBT)
+オブジェクトが最初に使われた行で警告が報告されることにも注意してください。
 
 =head1 SEE ALSO
 
@@ -984,7 +973,7 @@
 =begin meta
 
 Translate: Kentaro Shirakata <argra****@ub32*****>
-Status: in progress
+Status: completed
 
 =end meta
 



perldocjp-cvs メーリングリストの案内
Back to archive index