=encoding euc-jp =head1 NAME =begin original warnings - Perl pragma to control optional warnings =end original warnings - 選択的な警告を調整する Perl プラグマ =head1 SYNOPSIS use warnings; no warnings; use warnings "all"; no warnings "all"; use warnings::register; if (warnings::enabled()) { warnings::warn("some warning"); } if (warnings::enabled("void")) { warnings::warn("void", "some warning"); } if (warnings::enabled($object)) { warnings::warn($object, "some warning"); } warnings::warnif("some warning"); warnings::warnif("void", "some warning"); warnings::warnif($object, "some warning"); =head1 DESCRIPTION =begin original The C pragma is a replacement for the command line flag C<-w>, but the pragma is limited to the enclosing block, while the flag is global. See L for more information and the list of built-in warning categories. =end original C プラグマは、コマンドラインフラグ C<-w> の置き換えです; しかし、このフラグはグローバルなのですが、このプラグマは閉じられた ブロックに限定されます。 更なる情報と、組み込み警告カテゴリの一覧については L を 見てください。 =begin original If no import list is supplied, all possible warnings are either enabled or disabled. =end original インポートリストを与えない場合は、可能な限り全ての警告を有効にしたり 無効にしたりします。 =begin original A number of functions are provided to assist module authors. =end original いくつかの関数は、モジュール作成者の手助けをします。 =over 4 =item use warnings::register =begin original Creates a new warnings category with the same name as the package where the call to the pragma is used. =end original プラグマを呼び出したパッケージと同じ名前の新しい警告カテゴリを作成します。 =item warnings::enabled() =begin original Use the warnings category with the same name as the current package. =end original 現在のパッケージと同じ名前の警告カテゴリを使います。 =begin original Return TRUE if that warnings category is enabled in the calling module. Otherwise returns FALSE. =end original 呼ばれたモジュール内でその警告カテゴリが有効ならば真(TRUE)を返します。 そうでなければ偽(FALSE)を返します。 =item warnings::enabled($category) =begin original Return TRUE if the warnings category, C<$category>, is enabled in the calling module. Otherwise returns FALSE. =end original 呼ばれたモジュール内で警告カテゴリ(C<$category>)が有効ならば真 (TRUE)を返します。 そうでなければ偽(FALSE)を返します。 =item warnings::enabled($object) =begin original Use the name of the class for the object reference, C<$object>, as the warnings category. =end original オブジェクトリファレンス(C<$object>)のクラス名を警告カテゴリとして 使います。 =begin original Return TRUE if that warnings category is enabled in the first scope where the object is used. Otherwise returns FALSE. =end original そのオブジェクトが使われた最初のスコープ内でその警告カテゴリが有効ならば 真(TRUE)を返します。 そうでなければ偽(FALSE)を返します。 =item warnings::fatal_enabled() =begin original Return TRUE if the warnings category with the same name as the current package has been set to FATAL in the calling module. Otherwise returns FALSE. =end original 呼ばれたモジュール内で、現在のパッケージと同じ名前の警告カテゴリが FATAL に 設定されているならば真(TRUE)を返します。 そうでなければ偽(FALSE)を返します。 =item warnings::fatal_enabled($category) =begin original Return TRUE if the warnings category C<$category> has been set to FATAL in the calling module. Otherwise returns FALSE. =end original 呼ばれたモジュール内で、警告カテゴリ(C<$category>)が FATAL に 設定されているならば真(TRUE)を返します。 そうでなければ偽(FALSE)を返します。 =item warnings::fatal_enabled($object) =begin original Use the name of the class for the object reference, C<$object>, as the warnings category. =end original オブジェクトリファレンス(C<$object>)のクラス名を警告カテゴリとして 使います。 =begin original Return TRUE if that warnings category has been set to FATAL in the first scope where the object is used. Otherwise returns FALSE. =end original そのオブジェクトが使われた最初のスコープ内でその警告カテゴリが FATAL に 設定されているならば真(TRUE)を返します。 そうでなければ偽(FALSE)を返します。 =item warnings::warn($message) =begin original Print C<$message> to STDERR. =end original STDERR に C<$message> を出力します。 =begin original Use the warnings category with the same name as the current package. =end original 現在のパッケージと同じ名前の警告カテゴリを使います。 =begin original If that warnings category has been set to "FATAL" in the calling module then die. Otherwise return. =end original もし、呼ばれたモジュール内でその警告カテゴリーに "FATAL" が 設定されていたならば、終了(die)します。 =item warnings::warn($category, $message) =begin original Print C<$message> to STDERR. =end original STDERR に C<$message> を出力します。 =begin original If the warnings category, C<$category>, has been set to "FATAL" in the calling module then die. Otherwise return. =end original もし、呼ばれたモジュール内で警告カテゴリ(C<$category>)に "FATAL" が 設定されていたならば、終了(die)します。 =item warnings::warn($object, $message) =begin original Print C<$message> to STDERR. =end original STDERR に C<$message> を出力します。 =begin original Use the name of the class for the object reference, C<$object>, as the warnings category. =end original オブジェクトリファレンス(C<$object>)のクラス名を警告カテゴリとして 使います。 =begin original If that warnings category has been set to "FATAL" in the scope where C<$object> is first used then die. Otherwise return. =end original もし、C<$object> が最初に使われたスコープ内でその警告カテゴリに "FATAL" が設定されていたならば、終了(die)します。 =item warnings::warnif($message) =begin original Equivalent to: =end original 以下のものと等価です: if (warnings::enabled()) { warnings::warn($message) } =item warnings::warnif($category, $message) =begin original Equivalent to: =end original 以下のものと等価です: if (warnings::enabled($category)) { warnings::warn($category, $message) } =item warnings::warnif($object, $message) =begin original Equivalent to: =end original 以下のものと等価です: if (warnings::enabled($object)) { warnings::warn($object, $message) } =item warnings::register_categories(@names) =begin original This registers warning categories for the given names and is primarily for use by the warnings::register pragma, for which see L. =end original これは指定された名前の警告カテゴリを登録します; L にあるように、 主に warnings::register プラグマで使われるものです。 =back =begin original See L and L. =end original L と L を見てください。 =cut