argra****@users*****
argra****@users*****
2009年 5月 15日 (金) 01:44:59 JST
Index: docs/perl/5.10.0/perldiag.pod diff -u docs/perl/5.10.0/perldiag.pod:1.12 docs/perl/5.10.0/perldiag.pod:1.13 --- docs/perl/5.10.0/perldiag.pod:1.12 Thu Apr 23 01:01:20 2009 +++ docs/perl/5.10.0/perldiag.pod Fri May 15 01:44:59 2009 @@ -3617,7 +3617,7 @@ =end original -(P) マジック変数の内部処理がおかしくなっています。 +(P) マジカル変数の内部処理がおかしくなっています。 =item do_study: out of memory @@ -10440,7 +10440,7 @@ =end original (F) (?(condition)if-clause|else-clause) 構文の条件部が不明です。 -条件は前方参照または後方参照 (前方参照または後方参照が真なら条件は真)、 +条件は先読みまたは戻り読み (先読みまたは戻り読みが真なら条件は真)、 (?{...}) 構文 (コードが真の値に評価されれば真)、 数値 (番号付けされた、捕捉されたかっこの集合が定義されていれば真) の いずれかです。 Index: docs/perl/5.10.0/perlfaq8.pod diff -u docs/perl/5.10.0/perlfaq8.pod:1.7 docs/perl/5.10.0/perlfaq8.pod:1.8 --- docs/perl/5.10.0/perlfaq8.pod:1.7 Thu Jul 17 20:56:59 2008 +++ docs/perl/5.10.0/perlfaq8.pod Fri May 15 01:44:59 2009 @@ -1634,7 +1634,7 @@ =end original -open() の引数にシェルメタ文字がないなら、Perl はコマンドをシェルを使わずに +open() の引数にシェルのメタ文字がないなら、Perl はコマンドをシェルを使わずに 直接実行し、コマンドが開始したかどうかを正しく報告できます。 =head2 What's wrong with using backticks in a void context? Index: docs/perl/5.10.0/perlfunc.pod diff -u docs/perl/5.10.0/perlfunc.pod:1.6 docs/perl/5.10.0/perlfunc.pod:1.7 --- docs/perl/5.10.0/perlfunc.pod:1.6 Fri Apr 24 00:59:06 2009 +++ docs/perl/5.10.0/perlfunc.pod Fri May 15 01:44:59 2009 @@ -7215,7 +7215,7 @@ オープンされず、入出力は新しい STDOUT か STDIN に対して行なわれます。 これは、setuid で実行して、シェルコマンドのメタ文字を 検索させたくないような場合に、パイプコマンドの起動の仕方を -制御したいとき、普通のパイプのopen と同じように使います。 +制御したいとき、普通のパイプの open と同じように使います。 以下の組み合わせは、だいたい同じものです: open(FOO, "|tr '[a-z]' '[A-Z]'"); @@ -13878,11 +13878,11 @@ リストの最初の要素で与えられるプログラムを、リストの残りの要素を 引数として起動します。 スカラの引数が一つだけの場合、 -引数はシェルのメタキャラクタをチェックされ、もしあれば +引数はシェルのメタ文字をチェックされ、もしあれば パーズのために引数全体がシステムコマンドシェル (これは Unix プラットフォームでは C</bin/sh -c> ですが、 他のプラットフォームでは異なります)に渡されます。 -シェルメタキャラクタがなかった場合、 +シェルのメタ文字がなかった場合、 引数は単語に分解されて直接 C<execvp> に渡されます。 この方がより効率的です。 Index: docs/perl/5.10.0/perlglossary.pod diff -u docs/perl/5.10.0/perlglossary.pod:1.4 docs/perl/5.10.0/perlglossary.pod:1.5 --- docs/perl/5.10.0/perlglossary.pod:1.4 Fri Apr 24 00:59:06 2009 +++ docs/perl/5.10.0/perlglossary.pod Fri May 15 01:44:59 2009 @@ -3634,6 +3634,8 @@ =item impatience +(短気(impatience)) + =begin original The anger you feel when the computer is being lazy. This makes you @@ -3668,6 +3670,8 @@ =item import +(インポート(import)) + =begin original To gain access to symbols that are exported from another module. See @@ -3681,6 +3685,8 @@ =item increment +(インクリメント(increment)) + =begin original To increase the value of something by 1 (or by some other number, if @@ -3798,6 +3804,8 @@ =item infix +(中置(infix)) + =begin original An L</operator> that comes in between its L<operands|/operand>, such @@ -3940,6 +3948,8 @@ =item invocant +(呼び出し元(invocant)) + =begin original The agent on whose behalf a L</method> is invoked. In a L</class> @@ -4164,6 +4174,8 @@ =item laziness +(怠惰(laziness)) + =begin original The quality that makes you go to great effort to reduce overall energy @@ -4239,6 +4251,8 @@ =item lexical analysis +(レキシカル解析(lexical analysis)) + =begin original Fancy term for L</tokenizing>. @@ -4294,6 +4308,8 @@ =item library +(ライブラリ(library)) + =begin original Generally, a collection of procedures. In ancient days, referred to a @@ -4387,6 +4403,8 @@ =item link +(リンク(link)) + =begin original Used as a noun, a name in a L</directory>, representing a L</file>. A @@ -4480,6 +4498,8 @@ =item list value +(リスト値(list value)) + =begin original An unnamed list of temporary scalar values that may be passed around @@ -4531,6 +4551,8 @@ =item local +(ローカル(local)) + =begin original Not meaning the same thing everywhere. A global variable in Perl can @@ -4559,6 +4581,8 @@ =item lookahead +(先読み(lookahead)) + =begin original An L</assertion> that peeks at the string to the right of the current @@ -4572,6 +4596,8 @@ =item lookbehind +(戻り読み(lookbehind)) + =begin original An L</assertion> that peeks at the string to the left of the current @@ -4615,6 +4641,8 @@ =item loop label +(ループラベル(loop label)) + =begin original A kind of key or name attached to a loop (or roller coaster) so that @@ -4708,6 +4736,8 @@ =item magical increment +(マジカルインクリメント(magical increment)) + =begin original An L</increment> operator that knows how to bump up alphabetics as @@ -4721,6 +4751,8 @@ =item magical variables +(マジカル変数(magical variables)) + =begin original Special variables that have side effects when you access them or @@ -4797,6 +4829,8 @@ =item matching +(マッチング(matching)) + =begin original See L</pattern matching>. @@ -4819,6 +4853,8 @@ =item memory +(メモリ(memory)) + =begin original This always means your main memory, not your disk. Clouding the issue @@ -4848,6 +4884,8 @@ =item metacharacter +(メタ文字(metacharacter)) + =begin original A L</character> that is I<not> supposed to be treated normally. Which @@ -4869,6 +4907,8 @@ =item metasymbol +(メタシンボル(metasymbol)) + =begin original Something we'd call a L</metacharacter> except that it's a sequence of @@ -4886,6 +4926,8 @@ =item method +(メソッド(method)) + =begin original A kind of action that an L</object> can take if you tell it to. See @@ -4914,6 +4956,8 @@ =item mode +(モード(mode)) + =begin original In the context of the L<stat> syscall, refers to the field holding @@ -4942,6 +4986,8 @@ =item module +(モジュール(module)) + =begin original A L</file> that defines a L</package> of (almost) the same name, which @@ -4972,6 +5018,8 @@ =item monger +(モンガー(monger)) + =begin original Short for Perl Monger, a purveyor of Perl. @@ -4983,6 +5031,8 @@ =item mortal +(揮発性(mortal)) + =begin original A temporary value scheduled to die when the current statement @@ -4996,6 +5046,8 @@ =item multidimensional array +(多次元配列(multidimensional array)) + =begin original An array with multiple subscripts for finding a single element. Perl @@ -5011,6 +5063,8 @@ =item multiple inheritance +(多重継承(multiple inheritance)) + =begin original The features you got from your mother and father, mixed together @@ -5066,6 +5120,8 @@ =item network address +(ネットワークアドレス(network address)) + =begin original The most important attribute of a socket, like your telephone's @@ -5213,6 +5269,8 @@ =item object +(オブジェクト(object)) + =begin original An L</instance> of a L</class>. Something that "knows" what @@ -5249,6 +5307,8 @@ =item offset +(オフセット(offset)) + =begin original How many things you have to skip over when moving from the beginning @@ -5279,6 +5339,8 @@ =item open source software +(オープンソースソフトウェア(open source software)) + =begin original Programs for which the source code is freely available and freely @@ -5309,6 +5371,8 @@ =item operating system +(オペレーティングシステム(operating system)) + =begin original A special program that runs on the bare machine and hides the gory @@ -5363,6 +5427,8 @@ =item operator overloading +(演算子オーバーロード(operator overloading)) + =begin original A kind of L</overloading> that you can do on built-in @@ -5382,6 +5448,8 @@ =item options +(オプション(options)) + =begin original See either L<switches|/switch> or L</regular expression modifier>. @@ -5393,6 +5461,8 @@ =item overloading +(オーバーロード(overloading)) + =begin original Giving additional meanings to a symbol or construct. Actually, all @@ -5408,6 +5478,8 @@ =item overriding +(オーバーライド(overriding)) + =begin original Hiding or invalidating some other definition of the same name. (Not @@ -5435,6 +5507,8 @@ =item owner +(所有者(owner)) + =begin original The one user (apart from the superuser) who has absolute control over Index: docs/perl/5.10.0/perlop.pod diff -u docs/perl/5.10.0/perlop.pod:1.7 docs/perl/5.10.0/perlop.pod:1.8 --- docs/perl/5.10.0/perlop.pod:1.7 Wed Apr 22 01:06:25 2009 +++ docs/perl/5.10.0/perlop.pod Fri May 15 01:44:59 2009 @@ -3436,7 +3436,7 @@ この文字列がどのように評価されるかは完全にシステムのコマンドインタプリタに 依存します。 -ほとんどのプラットフォームでは、シェルのメタキャラクタをリテラルに +ほとんどのプラットフォームでは、シェルのメタ文字をリテラルに 扱ってほしい場合はそれを守る必要があります。 文字をエスケープする方法が明確ではないので、これは理論的には難しいことです。 逆クォートを安全にエミュレートするために手動で fork() と exec() を Index: docs/perl/5.10.0/perlretut.pod diff -u docs/perl/5.10.0/perlretut.pod:1.10 docs/perl/5.10.0/perlretut.pod:1.11 --- docs/perl/5.10.0/perlretut.pod:1.10 Sat Apr 4 01:35:44 2009 +++ docs/perl/5.10.0/perlretut.pod Fri May 15 01:44:59 2009 @@ -5619,13 +5619,11 @@ 以下の例では以前に説明した浮動小数点数のためのパターンを使った この機能を示しています。 -The three -subpatterns that are used more than once are the optional sign, the -digit sequence for an integer and the decimal fraction. +複数回使われる 3 つの副パターンは、省略可能の符号、整数のための +数字並び、小数点です。 パターンの末尾の DEFINE グループはこれらの定義を含んでいます。 小数点のパターンは整数のパターンを再利用できる最初の位置であることに 注意してください。 -(TBT) /^ (?&osg)\ * ( (?&int)(?&dec)? | (?&dec) ) (?: [eE](?&osg)(?&int) )? @@ -5654,15 +5652,14 @@ =end original -This feature (introduced in Perl 5.10) significantly extends the -power of Perl's pattern matching. By referring to some other -capture group anywhere in the pattern with the construct -C<(?group-ref)>, the I<pattern> within the referenced group is used -as an independent subpattern in place of the group reference itself. -Because the group reference may be contained I<within> the group it -refers to, it is now possible to apply pattern matching to tasks that -hitherto required a recursive parser. -(TBT) +(Perl 5.10 から導入された)この機能は、Perl のパターンマッチングの力を +大きく拡張します。 +パターン中の任意の位置の捕捉グループを C<(?group-ref)> 定数で参照することで、 +参照されたグループ内の I<パターン> はグループ参照自身の代わりに +独立した副パターンとして使われます。 +グループ参照は参照しているグループの I<内側> に含まれる場合もあるので、 +今までは再帰パーサが必要であった処理に対してパターンマッチングを +適用できるようになります。 =begin original @@ -5676,17 +5673,23 @@ =end original -To illustrate this feature, we'll design a pattern that matches if -a string contains a palindrome. (This is a word or a sentence that, -while ignoring spaces, interpunctuation and case, reads the same backwards -as forwards. We begin by observing that the empty string or a string -containing just one word character is a palindrome. Otherwise it must -have a word character up front and the same at its end, with another -palindrome in between. -(TBT) +この機能を説明するために、文字列が回文である場合にマッチングするパターンを +設計します。 +(回文とは、空白、句読点、大文字小文字を無視したとき、 +先頭から読んでも末尾から読んでも同じになる単語や文のことです。) +まず、空文字列あるいは一つの単語文字からなる文字列を回文として +観測することから始めます。 +さもなければ、回文とは先頭と末尾に同じ単語文字があって、その間に +回文があるものです。 + +=begin original /(?: (\w) (?...Here be a palindrome...) \{-1} | \w? )/x +=end original + + /(?: (\w) (?...ここは回文...) \{-1} | \w? )/x + =begin original Adding C<\W*> at either end to eliminate was is to be ignored, we already @@ -5694,9 +5697,8 @@ =end original -Adding C<\W*> at either end to eliminate was is to be ignored, we already -have the full pattern: -(TBT) +無視するべき文字のために両端に C<\W*> を追加することで、すでに +完全なパターンとなっています: my $pp = qr/^(\W* (?: (\w) (?1) \g{-1} | \w? ) \W*)$/ix; for $s ( "saippuakauppias", "A man, a plan, a canal: Panama!" ){ @@ -5712,11 +5714,10 @@ =end original -In C<(?...)> both absolute and relative backreferences may be used. -The entire pattern can be reinserted with C<(?R)> or C<(?0)>. -If you prefer to name your buffers, you can use C<(?&name)> to -recurse into that buffer. -(TBT) +C<(?...)> の中では絶対と相対の両方の後方参照が使えます。 +パターン全体は C<(?R)> または C<(?0)> で再挿入できます。 +バッファに名前を付けたいなら、そのバッファを再帰させるために C<(?&name)> が +使えます。 =head2 A bit of magic: executing Perl code in a regular expression @@ -6306,7 +6307,7 @@ =head2 Backtracking control verbs -(バックトラック制御動詞) +(バックトラッキング制御動詞) =begin original @@ -6320,14 +6321,13 @@ =end original -Perl 5.10 introduced a number of control verbs intended to provide -detailed control over the backtracking process, by directly influencing -the regexp engine and by providing monitoring techniques. As all -the features in this group are experimental and subject to change or -removal in a future version of Perl, the interested reader is -referred to L<perlre/"Special Backtracking Control Verbs"> for a -detailed description. -(TBT) +Perl 5.10 から、正規表現エンジンに直接影響を与えることと、監視技術を +提供することによって、バックトラッキング処理を詳細に制御するための +制御同士が導入されました。 +この分野の全ての機能は実験的であり、Perl の将来のバージョンでは +変更されたり削除されたりする可能性があります; +興味を持った読者は、詳細な記述については +L<perlre/"Special Backtracking Control Verbs"> を参照してください。 =begin original @@ -6374,9 +6374,8 @@ これがマッチングするときはいつでも、C<$count{'a'}++;> のような文が実行され、 文字のカウンタをインクリメントします。 Then C<(*FAIL)> does what it says, and -the regexp engine proceeds according to the book: as long as the end of -the string hasn't been reached, the position is advanced before looking -for another vowel. +正規表現エンジンは正規の方法で進行します: +文字列の末尾に達していない限り、位置は次の母音を探す手前まで進んでいます。 従って、マッチングするのとしないのとは違いはなく、正規表現エンジンは 文字列全体が検査されるまで進められます。 (注目すべきことに、以下のような代替案は、