[perldocjp-cvs 307] CVS update: docs/perl/5.10.0

Back to archive index

argra****@users***** argra****@users*****
2008年 11月 2日 (日) 21:59:15 JST


Index: docs/perl/5.10.0/perlsub.pod
diff -u docs/perl/5.10.0/perlsub.pod:1.3 docs/perl/5.10.0/perlsub.pod:1.4
--- docs/perl/5.10.0/perlsub.pod:1.3	Wed Jun 25 17:48:36 2008
+++ docs/perl/5.10.0/perlsub.pod	Sun Nov  2 21:59:15 2008
@@ -532,11 +532,10 @@
 
 =end original
 
-The C<BEGIN>, C<UNITCHECK>, C<CHECK>, C<INIT> and C<END> subroutines
-are not so much subroutines as named special code blocks, of which you
-can have more than one in a package, and which you can B<not> call
-explicitly.  See L<perlmod/"BEGIN, UNITCHECK, CHECK, INIT and END">
-(TBT)
+The C<BEGIN>, C<UNITCHECK>, C<CHECK>, C<INIT> and C<END> サブルーチンは
+サブルーチンというよりは特殊コードブロックで、その中でも一つのパッケージに
+複数作ることができ、明示的には B<呼び出せません> 。
+L<perlmod/"BEGIN, UNITCHECK, CHECK, INIT and END"> を参照してください。
 
 =head2 Private Variables via my()
 X<my> X<variable, lexical> X<lexical> X<lexical variable> X<scope, lexical>
@@ -1273,11 +1272,9 @@
 
 =end original
 
-いくつかの種類の左辺値もローカル化できます : hash and array elements
-and slices, conditionals (provided that their result is always
-localizable), and symbolic references.  As for simple variables, this
-creates new, dynamically scoped values.
-(TBT)
+いくつかの種類の左辺値もローカル化できます : ハッシュと配列の要素とスライス、
+条件文(その結果が常にローカル化可能なもの)、シンボリックリファレンス。
+単純変数に関しては、これは新しく、動的スコープを持つ値を作ります。
 
 =begin original
 
@@ -1394,11 +1391,10 @@
 
 =end original
 
-Note, however, that this restricts localization of some values ; for
-example, the following statement dies, as of perl 5.9.0, with an error
-I<Modification of a read-only value attempted>, because the $1 variable is
-magical and read-only :
-(TBT)
+しかし、これはいくつかの値のローカル化を制限することに注意してください;
+例えば、以下の文は、perl 5.9.0 からは、
+I<Modification of a read-only value attempted> というエラーで die します;
+なぜなら $1 変数はマジカルで読み込み専用だからです:
 
     local $1 = 2;
 
@@ -1409,9 +1405,8 @@
 
 =end original
 
-同様ですが、in a way more difficult to spot,
-以下のコード片は perl 5.9.0 では die します:
-(TBT)
+同様ですが、ある意味ではより見分けにくいですが、以下のコード片は
+perl 5.9.0 では die します:
 
     sub f { local $_ = "foo"; print }
     for ($1) {
@@ -1474,10 +1469,10 @@
 
 =end original
 
-creates a whole new symbol table entry for the glob C<name> in the
-current package.  That means that all variables in its glob slot ($name,
- @ name, %name, &name, and the C<name> filehandle) are dynamically reset.
-(TBT)
+現在のパッケージでグロブ C<name> のための完全に新しいシンボルテーブル
+エントリを作成します。
+これは、このグロブスロットに入る全ての変数 ($name, @name, %name, &name,
+C<name> ファイルハンドル) は動的にリセットされることを意味します。
 
 =begin original
 
@@ -1700,7 +1695,8 @@
 
 =end original
 
-They violate encapsulation.  A normal mutator can check the supplied
+これはカプセル化に違反しています。
+A normal mutator can check the supplied
 argument before setting the attribute it is protecting, an lvalue
 subroutine never gets that chance.  Consider;
 (TBT)
@@ -2627,7 +2623,7 @@
 
 =end original
 
-以下に挙げた関数はインライン展開されるでしょう:
+以下に挙げた関数は全てインライン展開されるでしょう:
 
 =begin original
 
@@ -2639,9 +2635,9 @@
 
 =end original
 
-    sub pi ()		{ 3.14159 }		# 正確ではないが結構良い
+    sub pi ()		{ 3.14159 }		# 正確ではないが近い
     sub PI ()		{ 4 * atan2 1, 1 }	# 可能な限り良いもの
-						# そしてこれもインライン展開されます!
+						# そしてこれも展開されます!
     sub ST_DEV ()	{ 0 }
     sub ST_INO ()	{ 1 }
 
@@ -2662,9 +2658,8 @@
 
 =end original
 
-Be aware that these will not be inlined; as they contain inner scopes,
-the constant folding doesn't reduce them to a single constant:
-(TBT)
+以下のものはインライン展開されないことに注意してください;
+より内側にスコープがあるので、畳み込まれた定数が一つの定数に削減できません:
 
     sub foo_set () { if (FLAG_MASK & FLAG_FOO) { 1 } }
 
@@ -2692,13 +2687,19 @@
 =end original
 
 インライン展開するのに適切であったサブルーチンを再定義すると強制的な
-警告を受けることになるでしょう(この警告を、あるサブルーチンが
-定数サブルーチンとして認識されるかどうかを区別するために使うことができます)。
-そのサブルーチンを際定義できる必要があるのならば、C<()> プロトタイプを
-やめる(これは呼び出しのセマンティクスを変えてしまいます。
-注意してください)か、以下の例のようにしてインライン展開機構を
+警告を受けることになります。
+(この警告を、あるサブルーチンが定数サブルーチンとして認識されるかどうかを
+区別するために使うことができます。)
+The warning is
+considered severe enough not to be optional because previously compiled
+invocations of the function will still be using the old value of the
+function.
+そのサブルーチンを再定義できる必要があるのならば、C<()> プロトタイプを
+やめる(これは呼び出しのセマンティクスを変えてしまうので注意してください)か、
+以下の例のようにしてインライン展開機構を
 働かせないようにしてサブルーチンがインライン展開されていないことを
 保証する必要があります。
+(TBT)
 
     sub not_inlined () {
     	23 if $];
@@ -2912,12 +2913,12 @@
 
 =end original
 
-When you override a built-in, your replacement should be consistent (if
-possible) with the built-in native syntax.  You can achieve this by using
-a suitable prototype.  To get the prototype of an overridable built-in,
-use the C<prototype> function with an argument of C<"CORE::builtin_name">
-(see L<perlfunc/prototype>).
-(TBT)
+組み込み関数をオーバーライドするとき、オーバーライドした関数は
+組み込み関数の元の文法(もしあれば)と一貫しているべきです。
+これは適切なプロトタイプを使うことで達成できます。
+オーバーライドできる組み込み関数のプロトタイプを得るためには、
+C<"CORE::builtin_name"> を引き数として C<prototype> 関数を使ってください
+(L<perlfunc/prototype> を参照してください)。
 
 =begin original
 
@@ -2955,10 +2956,10 @@
 
 =end original
 
-C<require> has special additional dark magic: if you invoke your
-C<require> replacement as C<require Foo::Bar>, it will actually receive
-the argument C<"Foo/Bar.pm"> in @_.  See L<perlfunc/require>.
-(TBT)
+C<require> は特別な追加の黒魔法を持ちます: C<require> をオーバーライドした
+ものを C<require Foo::Bar> として起動すると、実際には @_ に引き数として
+C<"Foo/Bar.pm"> を受け取ります。
+L<perlfunc/require> を参照してください。
 
 =begin original
 
@@ -2967,9 +2968,8 @@
 
 =end original
 
-And, as you'll have noticed from the previous example, if you override
-C<glob>, the C<< <*> >> glob operator is overridden as well.
-(TBT)
+そして、以前の例から気付いたかもしれませんが、もし C<glob> を
+オーバーライドすると、グロブ演算子 C<< <*> >> もオーバーライドされます。
 
 =begin original
 
@@ -2979,10 +2979,10 @@
 
 =end original
 
-In a similar fashion, overriding the C<readline> function also overrides
-the equivalent I/O operator C<< <FILEHANDLE> >>. Also, overriding
-C<readpipe> also overrides the operators C<``> and C<qx//>.
-(TBT)
+同様に、C<readline> 関数をオーバーライドすると 等価な
+I/O 演算子である C<< <FILEHANDLE> >> もオーバーライドします。
+また、C<readpipe> をオーバーライドすると、演算子 C<``> と C<qx//> も
+オーバーライドします。
 
 =begin original
 
Index: docs/perl/5.10.0/perlvar.pod
diff -u docs/perl/5.10.0/perlvar.pod:1.5 docs/perl/5.10.0/perlvar.pod:1.6
--- docs/perl/5.10.0/perlvar.pod:1.5	Thu Oct 16 04:22:24 2008
+++ docs/perl/5.10.0/perlvar.pod	Sun Nov  2 21:59:15 2008
@@ -182,11 +182,10 @@
 
 =end original
 
-since some other module, may want to read data from some file in the
-default "line mode", so if the code we have just presented has been
-executed, the global value of C<$/> is now changed for any other code
-running inside the same Perl interpreter.
-(TBT)
+なぜなら、その他のモジュールでは、デフォルトの「行モード」でファイルを
+読もうとするかも知れませんが、もし単に前述のコードを実行すると、
+C<$/> のグローバルな値が、同じ Perl インタプリタ内で実行される
+その他のコードに対しても変更されるからです。
 
 =begin original
 
@@ -198,9 +197,10 @@
 =end original
 
 Usually when a variable is localized you want to make sure that this
-change affects the shortest scope possible. So unless you are already
-inside some short C<{}> block, you should create one yourself. For
-example:
+change affects the shortest scope possible.
+従って、既に小さい C<{}> ブロックの内側であるのでない限り、それを
+自身で作るべきです。
+例えば:
 (TBT)
 
     my $content = '';
@@ -269,10 +269,8 @@
 
 =end original
 
-It's easy to notice the problem in such a short example, but in more
-complicated code you are looking for trouble if you don't localize
-changes to the special variables.
-(TBT)
+このような短い例では問題に気付くのは簡単ですが、より複雑なコードでは、
+もし特殊変数の変更をローカル化していないと問題を探すことになります。
 
 =begin original
 
@@ -405,11 +403,11 @@
 
 =end original
 
-As C<$_> is a global variable, this may lead in some cases to unwanted
-side-effects.  As of perl 5.9.1, you can now use a lexical version of
-C<$_> by declaring it in a file or in a block with C<my>.  Moreover,
-declaring C<our $_> restores the global C<$_> in the current scope.
-(TBT)
+C<$_> はグローバル変数なので、望まないような副作用を引き起こす場合があります。
+perl 5.9.1 から、ファイルやブロックで C<my> で宣言することで、
+レキシカル版の C<$_> が使えます。
+さらに、C<our $_> という宣言は現在のスコープでグローバルな C<$_> を
+再構築します。
 
 =begin original
 
@@ -438,12 +436,12 @@
 
 =end original
 
-Special package variables when using sort(), see L<perlfunc/sort>.
-Because of this specialness $a and $b don't need to be declared
-(using use vars, or our()) even when using the C<strict 'vars'> pragma.
-Don't lexicalize them with C<my $a> or C<my $b> if you want to be
-able to use them in the sort() comparison block or function.
-(TBT)
+sort() を使うときの特殊パッケージ変数です; L<perlfunc/sort> を
+参照してください。
+この特殊性により、$a と $b は、たとえ C<strict 'vars'> を使っているときでも
+(use vars や our() を使って) 宣言する必要がありません。
+これを sort() 比較ブロックや関数で使えるようにしたい場合は、
+C<my $a> や C<my $b> としてレキシカル化しないでください。
 
 =back
 
@@ -695,8 +693,8 @@
 
 The text matched by the used group most-recently closed (i.e. the group
 with the rightmost closing parenthesis) of the last successful search
-pattern.  (Mnemonic: the (possibly) Nested parenthesis that most
-recently closed.)
+pattern.
+(記憶法: (おそらく) もっとも最近閉じられた、ネストした (Nested) かっこ。)
 (TBT)
 
 =begin original
@@ -707,8 +705,9 @@
 
 =end original
 
-This is primarily used inside C<(?{...})> blocks for examining text
-recently matched. For example, to effectively capture text to a variable
+これは主として最近マッチしたテキストを調べるために C<(?{...})> ブロックの
+中で使われます。
+For example, to effectively capture text to a variable
 (in addition to C<$1>, C<$2>, etc.), replace C<(...)> with
 (TBT)
 
@@ -1446,9 +1445,8 @@
 
 =end original
 
-The behaviour of C<%-> is implemented via the
-L<Tie::Hash::NamedCapture> module.
-(TBT)
+C<%-> の振る舞いは L<Tie::Hash::NamedCapture> モジュールを使って
+実装されています。
 
 =begin original
 
@@ -1696,11 +1694,11 @@
 
 =end original
 
-The I<object reference> to the Encode object that is used to convert
-the source code to Unicode.  Thanks to this variable your perl script
-does not have to be written in UTF-8.  Default is I<undef>.  The direct
-manipulation of this variable is highly discouraged.
-(TBT)
+ソースコードを Unicode に変換するために使われる Encode オブジェクトへの
+I<オブジェクトリファレンス> 。
+この変数のおかげで、perl スクリプトを UTF-8 で書く必要がありません。
+デフォルトは I<undef> 。
+この変数を直接操作することはとても推奨できません。
 
 =item $OS_ERROR
 
@@ -1721,9 +1719,8 @@
 数値として使われると、その時点の C の C<errno> 変数の値が得られます;
 言い換えると、もしシステムコールやライブラリ呼び出しが失敗すると、
 この変数がセットされます。
-This means that the value of C<$!> is meaningful
-only I<immediately> after a B<failure>:
-(TBT)
+これは、C<$!> の値が意味を持つのは B<失敗> の I<直後> だけということを
+意味します。
 
     if (open(FH, $filename)) {
 	# Here $! is meaningless.
@@ -2215,10 +2212,8 @@
 
 =end original
 
-Note that there are platform specific limitations on the maximum
-length of C<$0>.  In the most extreme case it may be limited to the
-space occupied by the original C<$0>.
-(TBT)
+C<$0> の最大長にはプラットフォーム固有の制限があることに注意してください。
+最も極端な場合では、元の C<$0> で占められているサイズに制限されます。
 
 =begin original
 
@@ -2672,12 +2667,10 @@
 
 =end original
 
-In Windows platforms, $^O is not very helpful: since it is always
-C<MSWin32>, it doesn't tell the difference between
-95/98/ME/NT/2000/XP/CE/.NET.  Use Win32::GetOSName() or
-Win32::GetOSVersion() (see L<Win32> and L<perlport>) to distinguish
-between the variants.
-(TBT)
+Windows プラットフォームでは、$^O はあまり役に立ちません: これは常に
+C<MSWin32> となり、95/98/ME/NT/2000/XP/CE/.NET の違いを示していないからです。
+これらを区別するためには、Win32::GetOSName() や Win32::GetOSVersion() を
+使ってください (L<Win32> と L<perlport> を参照してください)。
 
 =item ${^OPEN}
 
@@ -2690,10 +2683,8 @@
 =end original
 
 PerlIO で使われる内部変数です。
-A string in two parts, separated
-by a C<\0> byte, the first part describes the input layers, the second
-part describes the output layers.
-(TBT)
+文字列は C<\0> で分割された二つの部分からなり、前半は入力層を、
+後半は出力層を示します。
 
 =item $PERLDB
 
@@ -2935,8 +2926,8 @@
 Perl のいくつかの Unicode 設定を反映します。
 See L<perlrun>
 documentation for the C<-C> switch for more information about
-the possible values. This variable is set during Perl startup
-and is thereafter read-only.
+the possible values.
+この変数は Perl 起動時に設定され、その後は読み込み専用です。
 (TBT)
 
 =item ${^UTF8CACHE}
@@ -3100,8 +3091,9 @@
 
 This variable could be set in the F<sitecustomize.pl> file to
 configure the local Perl installation to use "sloppy" stat() by
-default.  See L<perlrun> for more information about site
-customization.
+default.
+サイトカスタマイズに関するさらなる情報については L<perlrun> を
+参照してください。
 (TBT)
 
 =item $EXECUTABLE_NAME
@@ -3136,8 +3128,8 @@
 be the string used to invoke perl but not the pathname of the
 perl program file.  Also, most operating systems permit invoking
 programs that are not in the PATH environment variable, so there
-is no guarantee that the value of $^X is in PATH.  For VMS, the
-value may or may not include a version number.
+is no guarantee that the value of $^X is in PATH.
+VMS では、この値はバージョン番号を含む場合も含まない場合もあります。
 (TBT)
 
 =begin original
@@ -3147,9 +3139,8 @@
 
 =end original
 
-You usually can use the value of $^X to re-invoke an independent
-copy of the same perl that is currently running, e.g.,
-(TBT)
+通常は、現在実行中のものと同じ perl の独立したコピーを再起動するために
+$^X の値を使えます; つまり:
 
   @first_run = `$^X -le "print int rand 100 for 1..100"`;
 
@@ -3161,10 +3152,8 @@
 
 =end original
 
-But recall that not all operating systems support forking or
-capturing of the output of commands, so this complex statement
-may not be portable.
-(TBT)
+しかし、全ての OS が fork やコマンドの出力の捕捉に対応しているわけでは
+ないので、この複雑な文は移植性がないかもしれないことを忘れないでください。
 
 =begin original
 
@@ -3283,11 +3272,11 @@
 
 =end original
 
-The special filehandle that points to the currently open output file
-when doing edit-in-place processing with B<-i>.  Useful when you have
-to do a lot of inserting and don't want to keep modifying $_.  See
-L<perlrun> for the B<-i> switch.
-(TBT)
+B<-i> を使ってその場修正を行っているときに、現在開いている出力ファイルを
+示す特殊ファイルハンドルです。
+たくさんの挿入をする必要があるときに $_ を修正し続けたくない場合に
+有用です。
+B<-i> オプションについては L<perlrun> を参照してください。
 
 =item @F
 X<@F>
@@ -3301,8 +3290,10 @@
 
 =end original
 
-The array @F contains the fields of each line read in when autosplit
-mode is turned on.  See L<perlrun> for the B<-a> switch.  This array
+自動 split モードが有効の場合、配列 @F には読み込んだ行のフィールドを
+含みます。
+B<-a> オプションについては L<perlrun> を参照してください。
+This array
 is package-specific, and must be declared or given a full package name
 if not in package main when running under C<strict 'vars'>.
 (TBT)
@@ -3330,11 +3321,9 @@
 デフォルトの Perl ライブラリディレクトリ (おそらく
 F</usr/local/lib/perl5>) とカレントディレクトリを表わす
 "." を順につなげたものです。
-("." will not be appended if taint checks are enabled, either by
-C<-T> or by C<-t>.)
-実行時にこれを変更する必要がある場合は、
-マシン依存のライブラリを正しく読み込むために C<use lib> も使うべきです:
-(TBT)
+(C<-T> か C<-t> によって汚染チェックが有効の場合は、"." は追加されません。)
+実行時にこれを変更する必要がある場合は、マシン依存のライブラリも正しく
+読み込むために C<use lib> を使うべきです:
 
     use lib '/mypath/libdir/';
     use SomeMod;
@@ -3512,10 +3501,9 @@
 
 =end original
 
-The default delivery policy of signals changed in Perl 5.8.0 from 
-immediate (also known as "unsafe") to deferred, also known as 
-"safe signals".  See L<perlipc> for more information.
-(TBT)
+デフォルトのシグナル配送ポリシーは Perl 5.8.0 に即時("unsafe"としても
+知られます)から保留(「安全なシグナル」としても知られます)に変更されました。
+さらなる情報については L<perlipc> を参照してください。
 
 =begin original
 
@@ -3546,9 +3534,8 @@
 
 =end original
 
-As the C<'IGNORE'> hook is not supported by C<__WARN__>, you can
-disable warnings using the empty subroutine:
-(TBT)
+C<__WARN__> では C<'IGNORE'> フックには対応していないので、空サブルーチンを
+使って警告を無効に出来ます:
 
     local $SIG{__WARN__} = sub {};
 


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