Kentaro Shirakata
argra****@users*****
2006年 12月 13日 (水) 12:48:30 JST
Index: docs/perl/5.6.1/perldebug.pod diff -u docs/perl/5.6.1/perldebug.pod:1.4 docs/perl/5.6.1/perldebug.pod:1.5 --- docs/perl/5.6.1/perldebug.pod:1.4 Wed Mar 29 11:56:32 2006 +++ docs/perl/5.6.1/perldebug.pod Wed Dec 13 12:48:30 2006 @@ -625,12 +625,22 @@ アクションを設定します。 デバッガが実行する処理の順番は以下の通りです。 +=begin original + 1. check for a breakpoint at this line 2. print the line if necessary (tracing) 3. do any actions associated with that line 4. prompt user if at a breakpoint or in single-step 5. evaluate line +=end original + + 1. この行のブレークポイントをチェックします + 2. 必要なら行を表示します(トレース) + 3. この行に結び付けられたアクションを実行します + 4. ブレークポイントやシングルステップの場合はユーザーに確認します + 5. 行を評価します + =begin original For example, this will print out $foo every time line @@ -834,9 +844,17 @@ =item {{ command +=begin original + Add an action (debugger command) to happen before every debugger prompt. A multi-line command may be entered, if you can guess how: see above. +=end original + +毎回デバッガプロンプトを表示する前に実行するアクション(デバッガコマンド)を +追加します。予測可能な方法な方法で複数行コマンドも登録できます: +上記を参照してください。 + =item ! number =begin original @@ -916,20 +934,44 @@ これはデバッガを終了する唯一の方法ですが、C<exit> を2回 入力しても動作します。 +=begin original + Set the C<inhibit_exit> option to 0 if you want to be able to step off the end the script. You may also need to set $finished to 0 if you want to step through global destruction. +=end original + +スクリプトの最後にステップ実行できるようにしたい場合は、 +C<inhibit_exit> オプションに 0 を設定してください。 +グローバルなデストラクタを実行してステップ実行したい場合は、 +$finished に 0 を設定する必要があります。 + =item R +=begin original + Restart the debugger by C<exec()>ing a new session. We try to maintain your history across this, but internal settings and command-line options may be lost. +=end original + +新しいセッションを C<exec()> することでデバッガを再起動します。 +履歴は残そうと努力しますが、内部設定やコマンドラインオプションは +失われるかもしれません。 + +=begin original + The following setting are currently preserved: history, breakpoints, actions, debugger options, and the Perl command-line options B<-w>, B<-I>, and B<-e>. +=end original + +今のところ、以下の設定は保存されます: 履歴、ブレークポイント、アクション、 +デバッガオプション、Perl コマンドラインオプション B<-w>, B<-I>, B<-e>。 + =item |dbcmd =begin original @@ -1132,29 +1174,66 @@ =item C<arrayDepth>, C<hashDepth> +=begin original + Print only first N elements ('' for all). +=end original + +最初の N 要素だけを表示します('' を指定すると全て表示します)。 + =item C<compactDump>, C<veryCompact> +=begin original + Change the style of array and hash output. If C<compactDump>, short array may be printed on one line. +=end original + +配列とハッシュの出力スタイルを変更します。 +C<compactDump> の場合は、短い配列は 1 行で表示します。 + =item C<globPrint> +=begin original + Whether to print contents of globs. +=end original + +グロブの内容を表示するかどうかです。 + =item C<DumpDBFiles> +=begin original + Dump arrays holding debugged files. +=end original + +デバッグしていているファイルが保持している配列をダンプします。 + =item C<DumpPackages> +=begin original + Dump symbol tables of packages. +=end original + +パッケージのシンボルテーブルをダンプします。 + =item C<DumpReused> +=begin original + Dump contents of "reused" addresses. +=end original + +「再利用された」アドレスの内容をダンプします。 + =item C<quote>, C<HighBit>, C<undefPrint> Change the style of string dump. The default value for C<quote> @@ -1427,15 +1506,29 @@ C<$DB::trace> 変数は C<t> コマンドをタイプした状態をシミュレートするために 1 にセットするべきです。 +=begin original + Another way to debug compile-time code is to start the debugger, set a breakpoint on the I<load> of some module: +=end original + +コンパイル時に実行されるコードをデバッグするもう一つの方法は、 +モジュールの I<load> にブレークポイントを設定して: + DB<7> b load f:/perllib/lib/Carp.pm Will stop on load of `f:/perllib/lib/Carp.pm'. +=begin original + and then restart the debugger using the C<R> command (if possible). One can use C<b compile subname> for the same purpose. +=end original + +(可能なら) C<R> コマンドを使ってデバッガを再起動することです。 +C<b compile subname> も同じ目的に使えます。 + =head2 Debugger Customization (デバッガのカスタマイズ) Index: docs/perl/5.6.1/perlfunc.pod diff -u docs/perl/5.6.1/perlfunc.pod:1.9 docs/perl/5.6.1/perlfunc.pod:1.10 --- docs/perl/5.6.1/perlfunc.pod:1.9 Sun Apr 16 05:15:57 2006 +++ docs/perl/5.6.1/perlfunc.pod Wed Dec 13 12:48:30 2006 @@ -1,7 +1,13 @@ =head1 NAME +=begin original + perlfunc - Perl builtin functions +=end original + +perlfunc - Perl 組み込み関数 + =head1 DESCRIPTION =begin original @@ -106,13 +112,11 @@ Perl に B<-w> スイッチを付けて実行すれば、こういったものには 警告を出してくれます。 -たとえば、上記の 3 つめは: +たとえば、上記の 3 つめは、以下のような警告が出ます: print (...) interpreted as function at - line 1. Useless use of integer addition in void context at - line 1. -となります。 - =begin original A few functions take no arguments at all, and therefore work as neither @@ -461,6 +465,7 @@ -B ファイルは「バイナリ」ファイル (-T の反対) =begin original + -M Age of file in days when script started. -A Same for access time. -C Same for inode change time. @@ -471,12 +476,13 @@ -A 同様にアクセスがあってからの日数 -C 同様に inode が変更されてからの日数 +=begin original +Example: +=end original -があります。 - -Example: +例: while (<>) { chomp; @@ -497,7 +503,8 @@ =end original ファイルのパーミッション演算子 C<-r>, C<-R>, C<-w>, C<-W>, C<-x>, -C<-X> の解釈は、ファイルのモードとユーザの実効/実 uid と実効/実 gid のみから判断されます。 +C<-X> の解釈は、ファイルのモードとユーザの実効/実 uid と +実効/実 gid のみから判断されます。 実際にファイルが読めたり、書けたり、実行できたりするためには、 別の条件が必要かもしれません。 条件としてはネットワークファイルシステムアクセスコントロール、 @@ -515,11 +522,11 @@ =end original ローカルファイルシステムのスーパーユーザには、 -C<-r>, C<-R>, C<-w>, C<-W> に対して、常に 1 が返り、モード中のい -ずれかの実行許可ビットが立っていれば、C<-x>, C<-X> にも 1 -が返ることにも注意してください。 -スーパーユーザが実行するスクリプトでは、ファイルのモードを調べるために -は、stat() を行なうか、実効 uid を一時的に別のものにする +C<-r>, C<-R>, C<-w>, C<-W> に対して、常に 1 が返り、モード中の +いずれかの実行許可ビットが立っていれば、C<-x>, C<-X> にも 1 が +返ることにも注意してください。 +スーパーユーザが実行するスクリプトでは、ファイルのモードを調べるためには、 +stat() を行なうか、実効 uid を一時的に別のものにする 必要があるでしょう。 =begin original @@ -536,16 +543,17 @@ =end original -If you are using ACLs, there is a pragma called C<filetest> that may -produce more accurate results than the bare stat() mode bits. -When under the C<use filetest 'access'> the above-mentioned filetests -will test whether the permission can (not) be granted using the -access() family of system calls. Also note that the C<-x> and C<-X> may -under this pragma return true even if there are no execute permission -bits set (nor any extra execute permission ACLs). This strangeness is -due to the underlying system calls' definitions. Read the -documentation for the C<filetest> pragma for more information. -(*TBT*) +ACL を使っている場合は、生の stat() モードビットより +精度の高い結果を作成する C<filetest> プラグマがあります。 +C<use filetest 'access'> とした場合、上述したファイルテストは +システムコールの access() ファミリーを使って権限が与えられているか +どうかをテストします。 +また、このプラグマが指定されている場合、C<-x> と C<-X> は +たとえ実行許可ビット(または追加の実行許可 ACL)がセットされていない +場合でも真を返すことに注意してください。 +この挙動は使用するシステムコールの定義によるものです。 +さらなる情報については C<filetest> プラグマのドキュメントを +参照してください。 =begin original @@ -606,10 +614,10 @@ どのファイルテスト (あるいは、C<stat> や C<lstat>) 演算子にも、 下線だけから成る特別なファイルハンドルを与えると、 前回のファイルテスト (や stat) の stat 構造体が使われ、 -システムコールを省きます +システムコールを省きます。 (C<-t> には使えませんし、lstat() や C<-l> は実ファイルではなく、 シンボリックリンクの情報を stat 構造体に残すことを -覚えておく必要があります)。例: +覚えておく必要があります。)例: print "Can do.\n" if -r $a || -w _ || -x _; @@ -635,7 +643,7 @@ =end original 引数の絶対値を返します。 -VALUEが省略された場合は、 C<$_> を使います。 +VALUE が省略された場合は、C<$_> を使います。 =item accept NEWSOCKET,GENERICSOCKET @@ -649,8 +657,8 @@ accept(2) システムコールと同様に、着信するソケットの接続を受け付けます。 成功時にはパックされたアドレスを返し、失敗すれば偽を返します。 -L<perlipc/"Sockets: Client/Server Communication"> -の例を参照してください。 +L<perlipc/"Sockets: Client/Server Communication"> の +例を参照してください。 =begin original @@ -661,8 +669,8 @@ =end original ファイルに対する close-on-exec フラグをサポートしているシステムでは、 -フラグは$^F の値で決定される、新しくオープンされたファイル記述子に対して -セットされます。L<perlvar/$^F>を参照してください。 +フラグは $^F の値で決定される、新しくオープンされたファイル記述子に対して +セットされます。L<perlvar/$^F> を参照してください。 =item alarm SECONDS @@ -873,14 +881,12 @@ =end original -The operating system, device drivers, C libraries, and Perl run-time -system all work together to let the programmer treat a single -character (C<\n>) as the line terminator, irrespective of the external -representation. On many operating systems, the native text file -representation matches the internal representation, but on some -platforms the external representation of C<\n> is made up of more than -one character. -(*TBT*) +オペレーションシステム、デバイスドライバ、C ライブラリ、 +Perl ランタイムシステムは全て、プログラマが外部表現に関わらず +1 文字 (C<\n>) を行終端として扱えるように協調作業します。 +多くのオペレーティングシステムでは、ネイティブテキストファイル表現は +内部表現と同じですが、C<\n> の外部表現が複数文字になる +プラットフォームもあります。 Mac OS and all variants of Unix use a single character to end each line in the external representation of text (even though that single @@ -894,18 +900,39 @@ converted back to C<\cM\cJ> on output. This is what you want for text files, but it can be disastrous for binary files. +=begin original + Another consequence of using binmode() (on some systems) is that special end-of-file markers will be seen as part of the data stream. For systems from the Microsoft family this means that if your binary data contains C<\cZ>, the I/O subsystem will regard it as the end of the file, unless you use binmode(). +=end original + +binmode() を(いくつかのシステムで)使うことによるその他の作用としては、 +特別なファイル終端マーカーがデータストリームの一部として +見られることです。 +Microsoft ファミリーのシステムでは、binmode() を使っていないと +もしバイナリデータに C<\cZ> が含まれていたときに、I/O サブシステムが +これをファイル終端とみなすことを意味します。 + +=begin original + binmode() is not only important for readline() and print() operations, but also when using read(), seek(), sysread(), syswrite() and tell() (see L<perlport> for more details). See the C<$/> and C<$\> variables in L<perlvar> for how to manually set your input and output line-termination sequences. +=end original + +binmode() は readline() と print() 操作にだけではなく、 +read(), seek(), sysread(), syswrite(), tell() を使うときにも重要です +(詳細は L<perlport> を参照してください)。 +入出力の行端末シーケンスを手動でセットする方法については +L<perlvar> の C<$/> 変数と C<$\> 変数を参照してください。 + =item bless REF,CLASSNAME =item bless REF @@ -974,12 +1001,10 @@ スカラコンテキストでは、呼び元がある場合 (サブルーチン、C<eval>、C<require> の中にいるとき) には 呼び出し元のパッケージ名を返し、その他のときには未定義値を返します。 -リストコンテキストでは、 +リストコンテキストでは、以下を返します: ($package, $filename, $line) = caller; -を返します。 - =begin original With EXPR, it returns some extra information that the debugger uses to @@ -2573,7 +2598,7 @@ =end original -C< while (<>) >> ループの中では、 +C<< while (<>) >> ループの中では、 個々のファイルの終わりを調べるには、 C<eof>かC<eof(ARGV)>を用います。C<eof()>は最後のファイルの終わりのみを 調べます。例: