[perldocjp-cvs 1532] CVS update: docs/articles/qntm.org/files/perl

Back to archive index

ktats****@users***** ktats****@users*****
2012年 9月 2日 (日) 01:35:42 JST


Index: docs/articles/qntm.org/files/perl/perl.html
diff -u docs/articles/qntm.org/files/perl/perl.html:1.8 docs/articles/qntm.org/files/perl/perl.html:1.9
--- docs/articles/qntm.org/files/perl/perl.html:1.8	Sat Sep  1 17:40:49 2012
+++ docs/articles/qntm.org/files/perl/perl.html	Sun Sep  2 01:35:41 2012
@@ -55,13 +55,10 @@
 <h2 class=original>Preliminary notes</h2>
 <h2>前書き</h2>
 <ul class=original>
-<li><p>The following can be said of almost every declarative statement in this document: "that's not, strictly speaking, true; the situation is actually a lot more complicated".  If you see a serious lie, point it out, but I reserve the right to preserve certain critical lies-to-children.</p></li>
-<li><p>Throughout this document I'm using example <code>print</code> statements to output data but not explicitly appending line breaks. This is done to prevent me from going crazy and to give greater attention to the actual string being printed in each case, which is invariably more important. In many examples, this results in alotofwordsallsmusheduptogetherononeline if the code is run in reality. Try to ignore this. </li>
-</ul>
-
-<ul>
-<li><p>以下のことを、このドキュメント内のほとんどすべての宣言文で言うことが出来ます: "これは、厳格な意味での、真実ではありません; 状況は実際にはもっと複雑です"。私は故意に問題の"完全な真実"をわざわざ調べることを、省略したり、無視していますが、それは、アインシュタインの場の方程式で7年生の物理学の学生を始めるのに意味がないのと同じ理由です。もし深刻な嘘を見つけたら、指摘してください。ですが、私には子どもにつく重要な嘘をそのままにしておく権利があります。</p></li>
-<li><p>このドキュメントを通して、例において<code>print</code>ステートメントをデータを出力するために使っていますが、明示的に改行を追加していません。これは、私を気違いにさせないためであり、それぞれのケースで出力される、より重要な実際の文字列に多くの注意を向けさせるためです。多くの例で、実際にコードを動かすと、alotofwordsallsmusheduptogetherononelineのような結果になります。無視してください。</p></li>
+<li><p class="original">The following can be said of almost every declarative statement in this document: "that's not, strictly speaking, true; the situation is actually a lot more complicated".  If you see a serious lie, point it out, but I reserve the right to preserve certain critical lies-to-children.</p>
+<p>以下のことを、このドキュメント内のほとんどすべての宣言文で言うことが出来ます: "これは、厳格な意味での、真実ではありません; 状況は実際にはもっと複雑です"。私は故意に問題の"完全な真実"をわざわざ調べることを、省略したり、無視していますが、それは、アインシュタインの場の方程式で7年生の物理学の学生を始めるのに意味がないのと同じ理由です。もし深刻な嘘を見つけたら、指摘してください。ですが、私には子どもにつく重要な嘘をそのままにしておく権利があります。</p></li>
+<li><p class="original">Throughout this document I'm using example <code>print</code> statements to output data but not explicitly appending line breaks. This is done to prevent me from going crazy and to give greater attention to the actual string being printed in each case, which is invariably more important. In many examples, this results in alotofwordsallsmusheduptogetherononeline if the code is run in reality. Try to ignore this. </p>
+<p>このドキュメントを通して、例において<code>print</code>ステートメントをデータを出力するために使っていますが、明示的に改行を追加していません。これは、私を気違いにさせないためであり、それぞれのケースで出力される、より重要な実際の文字列に多くの注意を向けさせるためです。多くの例で、実際にコードを動かすと、alotofwordsallsmusheduptogetherononelineのような結果になります。無視してください。</p></li>
 </ul>
 
 <h2 class="original">Hello world</h2>
@@ -117,7 +114,7 @@
 	<li>他の変数へのリファレンス</li>
 </ul>
 
-<pre class="perl original">
+<pre class="perl prettyprint">
 my $undef = undef;
 print $undef; # raises a warning; prints the empty string ""
 
@@ -126,16 +123,6 @@
 print $undef2; # exactly the same warning; prints ""
 </pre>
 
-<pre class="perl original">
-my $num = 4040.5;
-print $num; # "4040.5"
-</pre>
-
-<pre class="perl original">
-my $string = "world";
-print $string; # "world"
-</pre>
-
 <pre class="perl prettyprint">
 my $num = 4040.5;
 print $num; # "4040.5"
@@ -177,7 +164,7 @@
 <p class=original><strong>It is impossible to determine whether a scalar contains a "number" or a "string".</strong> More precisely, it should never be necessary to do this. Whether a scalar behaves like a number or a string depends on the operator with which it is used. When used as a string, a scalar will behave like a string. When used as a number, a scalar will behave like a number (raising a warning if this isn't possible):</p>
 <p><strong>スカラーに"数字"か"変数"のいずれかが入っているのかを判断することはできません。</strong> より正確には、そんなことは見当違いです。Perlはその点で弱い型付けです。 スカラが数字か文字のどちらかのように振舞うかは、使われる演算子によります。文字列として使えば、スカラは文字列のようにふるまいます。数字として使えば、スカラは数字のようにふるまいます(また、そうすることが出来なければ、警告を発します):</p>
 
-<pre class="perl">
+<pre class="perl prettyprint">
 my $str1 = "4G";
 my $str2 = "4H";
 
@@ -269,13 +256,6 @@
 print "The last populated index is ".$#array;       # "The last populated index is 5"
 </pre>
 
-<p class=original>String concatenation using the <code>.</code> operator:</p>
-<p>文字列の結合には<code>.</code>演算子を使います:</p>
-
-<pre class="perl prettyprint">
-print $array[0].$array[1].$array[2]; # "printthesestrings"
-</pre>
-
 <p class=original>The arguments with which the original Perl script was invoked are stored in the <a href="http://perldoc.perl.org/perlvar.html">built-in array variable</a> <code>@ARGV</code>.</p>
 <p>オリジナルのPerlスクリプトの実行時の引数は、<a href="http://perldoc.perl.org/perlvar.html">組込の配列変数</a><code>@ARGV</code>に入ります。</p>
 
@@ -514,7 +494,7 @@
 <p class=original>A scalar expression evaluated in list context turns into a single-element list:</p>
 <p>スカラの式はリストコンテキストで評価されると、ひとつの値のリストとなります:</p>
 
-<pre class="perl">
+<pre class="perl prettyprint">
 my @array = "Mendeleev"; # same as 'my @array = ("Mendeleev");'
 </pre>
 
@@ -530,9 +510,9 @@
 my @array = ("Alpha", "Beta", "Gamma", "Pie");
 my $scalar = @array; # Value of $scalar is now 4
 </pre>
-<p class=original>The <code><a href="http://perldoc.perl.org/functions/print.html">print</a></code> built-in function evaluates all of its arguments in list context. In fact, <code>print</code> accepts an unlimited list of arguments and prints each one after the other, which means it can be used to print arrays directly:</p>
+<p class="original">The <code><a href="http://perldoc.perl.org/functions/print.html">print</a></code> built-in function evaluates all of its arguments in list context. In fact, <code>print</code> accepts an unlimited list of arguments and prints each one after the other, which means it can be used to print arrays directly:</p>
 <p><code><a href="http://perldoc.perl.org/functions/print.html">print</a></code> 組込関数は全ての引数をリストコンテキストで評価します。<code>print</code>は無制限のリストの引数を受取り、一つ一つ出力します。つまり、配列を直接与えることが出来ます。</p>
-<pre class="perl">
+<pre class="perl prettyprint">
 my @array = ("Alpha", "Beta", "Goo");
 my $scalar = "-X-";
 print @array;              # "AlphaBetaGoo";
@@ -550,7 +530,7 @@
 <p class=original>In the same way that lists cannot contain lists as elements, <strong>arrays and hashes cannot contain other arrays and hashes as elements.</strong> They can only contain scalars. Watch what happens when we try:</p>
 <p>リストが要素としてリストを含めないのと同様、<strong>配列とハッシュは他の配列やハッシュを要素として持てません</strong>。 両方ともスカラしか持てません。 今から試すことをよく見てください:</p>
 
-<pre class="perl">
+<pre class="perl prettyprint">
 my @outer = ("Sun", "Mercury", "Venus", undef, "Mars");
 my @inner = ("Earth", "Moon");
 
@@ -855,8 +835,7 @@
 </pre>
 
 <p class=original>Aside: singulars and plurals are best spelled out in full in both cases. Don't do something clever like the following, because anybody searching the codebase to replace the words "tooth" or "teeth" will never find this line:</p>
-<p>余談: 両方のケースの単数と複数を完全に書き出されています。決して以下のような巧妙なことをしないでください。
-コードを検索して、"tooth"か"teeth"の単語を置き換えようとしても、この行から見つけることができません。</p>
+<p>余談: 両方のケースの単数と複数を完全に書き出されています。決して以下のような巧妙なことをしないでください。コードを検索して、"tooth"か"teeth"の単語を置き換えようとしても、この行から見つけることができません。</p>
 
 <pre class="perl prettyprint">
 my $lost = 1;
@@ -876,8 +855,8 @@
 <p class=original><code>if</code> statements evaluate their conditions in scalar context. For example, <code>if(@array)</code> returns true if and only if <code>@array</code> has 1 or more elements. It doesn't matter what those elements are - they may contain <code>undef</code> or other false values for all we care.</p>
 <p><code>if/code>文では、これらの条件がはスカラコンテキストで価されます。<code>if(@array)</code>は、<code>@array</code>にひとつ以上のエレメントがある場合のみ、真となります。配列の中の値が何かは問題にしません - 全てが<code>undef</code>や他の偽の値でも</p>
 
-<h3 class=original>Array iteration</h3>
-<h3>配列のイテレーション</h3>
+<h2 class=original>Loops</h2>
+<h2>ループ</h2>
 
 <p class=original>There's More Than One Way To Do It.</p>
 <p>やりかたはひとつではありません。</p>
@@ -914,7 +893,8 @@
 } while ($i &lt; scalar @array);
 </pre>
 
-<p>and</p>
+<p class="original">and</p>
+<p>そして</p>
 
 <pre class="perl prettyprint">
 my $i = 0;
@@ -950,22 +930,6 @@
 }
 </pre>
 
-<p class=original>If you don't provide an explicit iterator, Perl uses a default iterator, <code>$_</code>. <code>$_</code> is the first and friendliest of the built-in variables:</p>
-<p>明示的なイテレータを使わなければ、Perlはデフォルトのイテレータとして<code>$_</code>を使います。<code>$_</code>は
-If you don't provide an explicit iterator, Perl uses a default iterator, . <code>$_</code>は最初のフレンドリーな組込の変数です:</p>
-
-<pre class="perl prettyprint">
-foreach ( @array ) {
-	print $_;
-}
-</pre>
-
-<p class=original>If using the default iterator, and you only wish to put a single statement inside your loop, you can use the super-short loop syntax:</p>
-<p>デフォルトのイテレータを使い、また、ループに単一のステートメントしか置かないなら、とても短いループのシンタックスを使えます:</p>
-<pre class="perl prettyprint">
-print $_ foreach @array;
-</pre>
-
 <p class=original>You can't iterate over a hash. However, you can iterate over its keys. Use the <code>keys</code> built-in function to retrieve an array containing all the keys of a hash. Then use the <code>foreach</code> approach that we used for arrays:</p>
 <p>ハッシュはイテレートできません。そのキーをイテレートできます。組込関数の<code>keys</code>を使って、ハッシュの全てのキーを含む配列を取り出してください。それから、配列で使った<code>foreach</code>のアプローチを使います:</p>
 
@@ -983,6 +947,15 @@
 }
 </pre>
 
+<p class="original">If you don't provide an explicit iterator, Perl uses a default iterator, <code>$_</code>. <code>$_</code> is the first and friendliest of <a href="http://perldoc.perl.org/perlvar.html">built-in variables</a>:</p>
+<p>明示的なイテレータを使わなければ、Perlはデフォルトのイテレータとして<code>$_</code>を使います。<code>$_</code>は最初の最もフレンドリーな<a href="http://perldoc.perl.org/perlvar.html">組込の変数</a>です:</p>
+
+<pre class="perl prettyprint">
+foreach ( @array ) {
+	print $_;
+}
+</pre>
+
 <p class="original">If using the default iterator, and you only wish to put a single statement inside your loop, you can use the super-short loop syntax:</p>
 <p>デフォルトのイテレータを使うなら、ループに一つのステートメントしか置かないのなら、とても短いループのシンタックスを使えます:</p>
 <pre class="perl prettyprint">
@@ -996,7 +969,7 @@
 
 <p><code>next</code> と <code>last</code>はループ進みを制御するのに使われます。多くのプログラミング言語では、それぞれ、<code>continue</code> と <code>break</code>となっています。オプションで、どのループにもラベルをつけることができます。慣例により、ラベルは <code>全て大文字で</code>書くことになっています。ループにラベルをつけることで、<code>next</code> と <code>last</code> にラベルを対象にできます。100未満の素数を見つける例です:</p>
 
-<pre class="perl">
+<pre class="perl prettyprint">
 CANDIDATE: for my $candidate ( 3 .. 100 ) {
 	for my $divisor ( 2 .. <a href="http://perldoc.perl.org/functions/sqrt.html">sqrt</a> $candidate ) {
 		next CANDIDATE if $candidate % $divisor == 0;
@@ -1198,7 +1171,7 @@
 <p class=original>Although the brackets are optional, subroutines should always be invoked using brackets, even when called with no arguments. This makes it clear that a subroutine call is happening.</p>
 <p>括弧はオプションですが、サブルーチンは、引数がひとつも無くても、常に括弧付きで使うべきです。こうしておけば、サブルーチンが呼ばれたことが、明確になります。</p>
 
-<p class=original>Once you're inside a subroutine, the arguments are available using the <a href="http://perldoc.perl.org/perlvar.html">built-in array variable</a> <code>@_</code>>. Examples:</p>
+<p class=original>Once you're inside a subroutine, the arguments are available using the <a href="http://perldoc.perl.org/perlvar.html">built-in array variable</a> <code>@_</code>. Example:</p>
 <p>サブルーチンの中に入ってしまうと、<a href="http://perldoc.perl.org/perlvar.html">組込の配列変数</a><code>@_</code>が使えます。例:</p>
 
 <pre class="perl prettyprint">
@@ -1266,7 +1239,7 @@
 </pre>
 		<p class=original>If no array is provided to the <code>shift</code> function, then it operates on <code>@_</code> implicitly. This approach is seen very commonly:</p>
 		<p><code>shift</code>に配列を渡さなければ、暗黙に、<code>@_</code>に対して操作します。このアプローチはとてもよく見られます:</p>
-<pre class="perl">
+<pre class="perl prettyprint">
 sub left_pad {
 	my $oldString = shift;
 	my $width     = shift;
@@ -1334,10 +1307,7 @@
 <p class="original">You can exit from a Perl script with the return code of your choice (from 0 to 255) using <code>exit</code>.</p>
 <p>Perlから終了する際に、<code>exit</code>を使って(0から255までの)好きなリターンコードを返せます。</p>
 <p class="original">Perl provides More Than One Way To - in a single call - spawn a child process, pause the current script until the child process has finished, and then resume interpretation of the current script. Whichever method is used, you will find that immediately afterwards, the <a href="http://perldoc.perl.org/perlvar.html">built-in scalar variable</a> <code>$?</code> has been populated with the status word that was returned from that child process's termination. You can get the return code by taking just the highest 8 of those 16 bits: <code>$? >> 8</code>.</p>
-<p>Perlには一つ以上の - 子プロセスを産む - 方法があります。現在のスクリプトを止め、子プロセスが終わったら、現在のスクリプトの解釈を続けます。どの方法を使っても、その直後で、子プロセスの終了時に返された状態ワードが入っている、<a href="http://perldoc.perl.org/perlvar.html">組込のスカラ変数</a>の<code>$?</code>に入ります。
-
-
-を見つけられます。16ビットの上位8を取ることで、リターンコードを得ることができます: <code>$? >> 8</code>。</p>
+<p>Perlには一つ以上の - 子プロセスを産む - 方法があります。現在のスクリプトを止め、子プロセスが終わったら、現在のスクリプトの解釈を続けます。どの方法を使っても、その直後で、子プロセスの終了時に返された状態ワードが入っている、<a href="http://perldoc.perl.org/perlvar.html">組込のスカラ変数</a>の<code>$?</code>に入ります。返された値の16ビットの上位8を取ることで、リターンコードを得ることができます: <code>$? >> 8</code>。</p>
 <p class="original">The <code>system</code> function can be used to invoke another program with the arguments listed. The value returned by <code>system</code> is the same value with which <code>$?</code> is populated:</p>
 <p><code>system</code>関数は他のプログラムを引数のリストと一緒に呼び出せます。<code>system</code>によって返される値は、<code>$?</code>に入るのと同じ値です:</p>
 <pre class="perl prettyprint">
@@ -1358,7 +1328,7 @@
 use warnings;
 
 print @ARGV;
-exit(37);
+exit 37;
 </pre>
 
 <h2 class="original">Files and file handles</h2>
@@ -1398,9 +1368,9 @@
 	# process the line...
 }
 </pre>
-<p>To truncate that possible trailing line break, use <code><a href="http://perldoc.perl.org/functions/chomp.html">chomp</a></code>:</p>
+<p class="original">To truncate that possible trailing line break, use <code><a href="http://perldoc.perl.org/functions/chomp.html">chomp</a></code>:</p>
 <p><code><a href="http://perldoc.perl.org/functions/chomp.html">chomp</a></code>を使うと改行を取り除けます:</p>
-<pre class="perl">
+<pre class="perl prettyprint">
 chomp $line;
 </pre>
 <p class="original">Note that <code>chomp</code> acts on <code>$line</code> in place. <code>$line = chomp $line</code> is probably not what you want.</p>
@@ -1422,6 +1392,7 @@
 	# process $line...
 }
 </pre>
+<p class="original">And even:</p>
 <p>次のようにさえ:</p>
 <pre class="perl prettyprint">
 while(&lt;$fh&gt;) {
@@ -1440,24 +1411,24 @@
 <p class=original>File handles are actually closed automatically when they drop out of scope, but otherwise:</p>
 <p>ファイルハンドルはスコープを抜けると自動的に閉じられます。もしくは:</p>
 
-<pre class="perl">
+<pre class="perl prettyprint">
 <a href="http://perldoc.perl.org/functions/close.html">close</a> $fh2;
 close $fh;
 </pre>
 
 <p class="original">Three filehandles exist as global constants: <code>STDIN</code>, <code>STDOUT</code> and <code>STDERR</code>. These are open automatically when the script starts. To read a single line of user input:</p>
 <p>3つのファイルハンドルがグローバルな定数としてあります: <code>STDIN</code>と<code>STDOUT</code>と<code>STDERR</code>があります。これらはスクリプトが開始されたときに自動的に開かれます。ユーザーの入力を一行読むには:</p>
-<pre class="perl">
+<pre class="perl prettyprint">
 my $line = &lt;STDIN&gt;;
 </pre>
 <p class="original">To just wait for the user to hit Enter:</p>
 <p>ユーザーがエンターを押すまで待つだけです:</p>
-<pre class="perl">
+<pre class="perl prettyprint">
 &lt;STDIN&gt;;
 </pre>
 <p class="original">Calling <code>&lt;&gt;</code> with no filehandle reads data from standard input, or from any files named in arguments when the Perl script was called.</p>
 <p><code>&lt;&gt;</code>をファイルハンドルなしで呼ぶと、標準入力からデータを読むか、Perlスクリプトが呼ばれた時の引数に渡された名前のファイルから読みます。</p>
-<p>As you may have gathered, <code>print</code> prints to <code>STDOUT</code> by default if no filehandle is named.</p>
+<p class="original">As you may have gathered, <code>print</code> prints to <code>STDOUT</code> by default if no filehandle is named.</p>
 <p>分かるかと思いますが、<code>print</code>は、ファイルハンドルが省略された場合は、デフォルトで<code>STDOUT</code>に出力しますす。</p>
 
 <h3 class=original>File tests</h3>
@@ -1475,23 +1446,29 @@
 <p class=original>These are just three of <a href="http://perldoc.perl.org/functions/-X.html">a large class of functions</a> of the form <code>-X</code> where <code>X</code> is some lower- or upper-case letter. These functions are called <i>file tests</i>. Note the leading minus sign. In a Google query, the minus sign indicates to exclude results containing this search term. This makes file tests hard to Google for! Just search for "perl file test" instead.</p>
 <p><code>-X</code>形式の<a href="http://perldoc.perl.org/functions/-X.html">大きなクラスの関数</a>の3つの関数です。<code>X</code>は小文字か大文字です。これらの関数は<i>ファイルテスト</i>と呼ばれます。マイナス記号が先に来ることに気をつけてください。Googleクエリでは、マイナス記号は、その言葉を結果に含めないことを指示します。そのため、ファイルテストをGoogleで検索しづらくしています! 代わりに、"perl file test"で検索して下さい。</p>
 
-<h2>Regular expressions</h2>
-<p>Regular expressions appear in many languages and tools other than Perl. Perl's core regular expression syntax is basically the same as everywhere else. (Perl's <em>full</em> regular expression capabilities are terrifyingly complex and difficult to understand; the best advice I can give you is to avoid this complexity wherever possible.)</p>
-<p>Match operations are performed using <code>=~ m//</code>. In scalar context, <code>=~ m//</code> returns true on success, false on failure.</p>
+<h2 class="original">Regular expressions</h2>
+<h2>正規表現</h2>
+<p class="original">Regular expressions appear in many languages and tools other than Perl. Perl's core regular expression syntax is basically the same as everywhere else. (Perl's <em>full</em> regular expression capabilities are terrifyingly complex and difficult to understand; the best advice I can give you is to avoid this complexity wherever possible.)</p>
+<p>正規表現はPerl以外の多くの言語やツールにみられます。Perlのコアの正規表現シンタックスは他のものと基本的に同じです。(Perlの<em>完全な</em>正規表現の性能は恐ろしく複雑で理解するのが難しいです; 一番良いアドバイスをするとしたら、可能な限りこういた複雑なものを避けるということです)。</p>
+<p class="original">Match operations are performed using <code>=~ m//</code>. In scalar context, <code>=~ m//</code> returns true on success, false on failure.</p>
+<p>マッチは、マッチ演算子<code>=~ m//</code>を使ってされます。スカラコンテキストでは、<code>=~ m//</code>は、成功なら真を返し、失敗なら偽を返します。</p>
 
-<pre class="perl">
+<pre class="perl prettyprint">
 my $string = "Hello world";
 if($string =~ m/(\w+)\s+(\w+)/) {
 	print "success";
 }
 </pre>
-<p>Parentheses perform sub-matches. After a successful match operation is performed, the sub-matches get stuffed into the built-in variables <code>$1</code>, <code>$2</code>, <code>$3</code>, ...:</p>
-<pre class="perl">
+<p class="original">Parentheses perform sub-matches. After a successful match operation is performed, the sub-matches get stuffed into the built-in variables <code>$1</code>, <code>$2</code>, <code>$3</code>, ...:</p>
+<p>括弧はサブマッチになります。マッチが成功したら、サブマッチは組込変数の<code>$1</code>, <code>$2</code>, <code>$3</code>, ...にマッチしたものが入ります:</p>
+<pre class="perl prettyprint">
 print $1; # "Hello"
 print $2; # "world"
 </pre>
-<p>In list context, <code>=~ m//</code> returns <code>$1</code>, <code>$2</code>, ... as a list.</p>
-<pre class="perl">
+<p class="original">In list context, <code>=~ m//</code> returns <code>$1</code>, <code>$2</code>, ... as a list.</p>
+<p>リストコンテキストでは、<code>=~ m//</code> は<code>$1</code>, <code>$2</code>, ... をリストとして返します:</p>
+
+<pre class="perl prettyprint">
 my $string = "colourless green ideas sleep furiously";
 my @matches = $string =~ m/(\w+)\s+((\w+)\s+(\w+))\s+(\w+)\s+(\w+)/;
 
@@ -1499,33 +1476,40 @@
 # prints "'colourless', 'green ideas', 'green', 'ideas', 'sleep', 'furiously'"
 </pre>
 
-<p>Substitution operations are performed using <code>=~ s///</code>.</p>
-<pre class="perl">
+<p class="original">Substitution operations are performed using <code>=~ s///</code>.</p>
+<p>置換操作は<code>=~ s///</code>で行います。</p>
+<pre class="perl prettyprint">
 my $string = "Good morning world";
 $string =~ s/world/Vietnam/;
 print $string; # "Good morning Vietnam"
 </pre>
-<p>Notice how the contents of <code>$string</code> have changed. You have to pass a scalar variable on the left-hand side of an <code>=~ s///</code> operation. If you pass a literal string, you'll get an error.</p>
+<p class="original">Notice how the contents of <code>$string</code> have changed. You have to pass a scalar variable on the left-hand side of an <code>=~ s///</code> operation. If you pass a literal string, you'll get an error.</p>
+<p><code>$string</code>の中身を変更する方法に注意してください。<code>=~ s///</code> 操作の左側にスカラ変数を渡さなければなりません。リテラルの文字列を渡した場合、エラーになります。</p>
+
+<p class="original">The <code>/g</code> flag indicates "group match".</p>
+<p><code>/g</code>フラグは"グループマッチ"を指示します。</p>
 
-<p>The <code>/g</code> flag indicates "group match".</p>
+<p class="original">In scalar context, each <code>=~ m//g</code> call finds another match after the previous one, returning true on success, false on failure. You can access <code>$1</code> and so on afterwards in the usual way. For example:</p>
+<p>スカラコンテキストでは、それぞれの<code>=~ m//g</code> 呼び出しは前のものの後の他のマッチを探し、成功すると真を返し、失敗すると値を返します。よくある方法で<code>$1</code>などにアクセス出来ます。 例:</p>
 
-<p>In scalar context, each <code>=~ m//g</code> call finds another match after the previous one, returning true on success, false on failure. You can access <code>$1</code> and so on afterwards in the usual way. For example:</p>
-<pre class="perl">
+<pre class="perl prettyprint">
 my $string = "a tonne of feathers or a tonne of bricks";
 while($string =~ m/(\w+)/g) {
   print "'".$1."'\n";
 }
 </pre>
 
-<p>In list context, an <code>=~ m//g</code> call returns all of the matches at once.</p>
-<pre class="perl">
+<p class="original">In list context, an <code>=~ m//g</code> call returns all of the matches at once.</p>
+<p>リストコンテキストでは、<code>=~ m//g</code>呼び出しは、マッチしたものを一度に全部返します。</p>
+<pre class="perl prettyprint">
 my @matches = $string =~ m/(\w+)/g;
 print join ", ", map { "'".$_."'" } @matches;
 </pre>
 
-<p>An <code>=~ s///g</code> call performs a global search/replace and returns the number of matches. Here, we replace all vowels with the letter "r".</p>
+<p class="original">An <code>=~ s///g</code> call performs a global search/replace and returns the number of matches. Here, we replace all vowels with the letter "r".</p>
+<p><code>=~ s///g</code>呼び出しはグローバルな検索/置換でマッチした数を返します。ここでは、すべての母音を文字"r"に置換しています。</p>
 
-<pre class="perl">
+<pre class="perl prettyprint">
 # Try once without /g.
 $string =~ s/[aeiou]/r/;
 print $string; # "r tonne of feathers or a tonne of bricks"
@@ -1539,9 +1523,11 @@
 print $string, "\n"; # "r trnnr rf frrthrrs rr r trnnr rf brrcks"
 </pre>
 
-<p>The <code>/i</code> flag makes matches and substitutions case-insensitive.</p>
-<p>The <code>/x</code> flag allows your regular expression to contain whitespace (e.g., line breaks) and comments.</p>
-<pre class="perl">
+<p class="original">The <code>/i</code> flag makes matches and substitutions case-insensitive.</p>
+<p><code>/i</code> フラグはマッチと置換をケースインセンシティブにします。</p>
+<p class="original">The <code>/x</code> flag allows your regular expression to contain whitespace (e.g., line breaks) and comments.</p>
+<p class="original"><code>/x</code>フラグは正規表現の中に空白(e.g. 改行)やコメントを含めることができるようにします。</p>
+<pre class="perl prettyprint">
 "Hello world" =~ m/
   (\w+) # one or more word characters
   [ ]   # single literal space, stored inside a character class
@@ -1551,98 +1537,132 @@
 # returns true
 </pre>
 
-<h2 class=original>Packages and modules</h2>
-<h2>パッケージとモジュール</h2>
+<h2 class=original>Modules and packages</h2>
+<h2>モジュールとパッケージ</h2>
+
+<p class="original">In Perl, modules and packages are different things.</p>
+<p>Perlにおいて、モジュールとパッケージは別物です。</p>
+
+
+<h3 class=original>Modules</h3>
+<h3>モジュール</h3>
+
+<p class=original>A <i>module</i> is a <code>.pm</code> file that you can include in another Perl file (script or module). A module is a text file with exactly the same syntax as a <code>.pl</code> Perl script. An example module might be located at <code>C:\foo\bar\baz\Demo\StringUtils.pm</code> or <code>/foo/bar/baz/Demo/StringUtils.pm</code>, and read as follows:</p>
+<p>A <i>モジュール</i>は、他のPerlファイル(スクリプトかモジュール)に含めることが出来る<code>.pm</code>ファイルです。モジュールは <code>.pl</code> Perlスクリプトとまったく同じシンタックのステキストファイルです。例のモジュールは、<code>C:\foo\bar\baz\Demo\StringUtils.pm</code> か <code>/foo/bar/baz/Demo/StringUtils.pm</code>にあります。続きを読んでください:</p>
+<pre class="perl prettyprint">
+use strict;
+use warnings;
+
+sub zombify {
+	my $word = shift @_;
+	$word =~ s/[aeiou]/r/g;
+	return $word;
+}
+
+return 1;
+</pre>
+
+<p class=original>Because a module is executed from top to bottom when it is loaded, you need to return a true value at the end to show that it was loaded successfully.</p>
+<p>モジュールはロードされると、最初から最後まで実行されるので、ロードが成功したことを示すために、最後に真の値を返す必要があります。</p>
+
+<p class=original>So that the Perl interpreter can find them, directories containing Perl modules should be listed in your environment variable <code>PERL5LIB</code> beforehand. List the root directory containing the modules, don't list the module directories or the modules themselves:</p>
+<p>Perlインタープリタはそれらを見つけることができるためには、その前に、Perlモジュールが入っているディレクトリが、環境変数<code>PERL5LIB</code>にリストされているべきです。モジュールが入っているルートディレクトリをリストしてください。モジュールのディレクトリやモジュール自身をリストしてはいけません。</p>
+
+<pre class="bash">
+set PERL5LIB=C:\foo\bar\baz;%PERL5LIB%
+</pre>
+<p class=original>or</p>
+<p>または</p>
+<pre class="bash">
+export PERL5LIB=/foo/bar/baz:$PERL5LIB
+</pre>
+
+<p class=original>Once the Perl module is created and <code>perl</code> knows where to look for it, you can use the <code>require</code> built-in function to search for and execute it during a Perl script. For example, calling <code>require Demo::StringUtils</code> causes the Perl interpreter to search each directory listed in <code>PERL5LIB</code> in turn, looking for a file called <code>Demo/StringUtils.pm</code>. After the module has been loaded, the subroutines and variables that were defined there suddenly become available in the main script. Our example script might be called <code>main.pl</code> and read as follows:</p>
+<p>Perlモジュールが作られて、<code>perl</code>がそれがどこにあるかを知っていれば、組込の<code>require</code>関数を使って探し、Perlのスクリプト中で実行することができます。例えば、<code>require Demo::StringUtils</code>を呼ぶと、Perlインタープリタは<code>PERL5LIB</code>にリストされているディレクトリを順番に、<code>Demo/StringUtils.pm</code>というファイルを探します。モジュールがロードされたら、突然にサブルーチンと変数がメインスクリプトに定義されます。この例のスクリプトを<code>main.pl</code>と呼びましょう。続けて読んでくさい:</p>
+
+<pre class="perl prettyprint">
+use strict;
+use warnings;
+
+require Demo::StringUtils;
+
+print zombify("i want brains"); # "r wrnt brrrns"
+</pre>
+
+<p class="original"><i>Note the use of the double colon <code>::</code> as a directory separator.</i></p>
+<p><i>名前空間の区切りに<code>::</code>を使っているのに注意してください</i></p>
 
-<p class=original>In Perl, packages and modules are different things.</p>
-<p>Perlでは、パッケージとモジュールは違うものです。</p>
+<p class="original">Now a problem surfaces: if <code>main.pl</code> contains many <code>require</code> calls, and each of the modules so loaded contains more <code>require</code> calls, then it can become difficult to track down the original declaration of the <code>zombify</code> subroutine. The solution to this problem is to use packages.</p>
+<p>ここで問題が表面化します: <code>main.pl</code>が、多くの<code>require</code> を呼んでいて、それぞれのモジュールがさらに<code>require</code>を呼んでいる場合、<code>zombify</code>サブルーチンの元の宣言がどこにあるのか、追いにくくなります。その解決策としては、パッケージを使うことです。</p>
 
 <h3 class=original>Packages</h3>
 <h3>パッケージ</h3>
 
-<p class=original>A <i>パッケージ</i> is a namespace in which subroutines and package variables can be declared. Any subroutine or package variable you declare is implicitly declared within the current package. At the beginning of execution, you are in the <code>main</code> package, but you can switch package using the <code>package</code> built-in function:</p>
-<p><i>package</i>は名前空間で、その中で、宣言したサブルーチンやパッケージ変数は、暗黙的に、現在のパッケージ内で宣言されます。実行の最初は、<code>main</code>パッケージになりますが、組込関数の<code>package</code>を使って、パッケージを切り替えられます:</p>
+<p class=original>A <i>package</i> is a namespace in which subroutines can be declared. Any subroutine you declare is implicitly declared within the current package. At the beginning of execution, you are in the <code>main</code> package, but you can switch package using the <code>package</code> built-in function:</p>
+<p><i>package</i>は名前空間で、その中で、サブルーチンを宣言できます。宣言したサブルーチンは、暗黙的に、現在のパッケージ内に宣言されます。実行の最初は、<code>main</code>パッケージになりますが、組込関数の<code>package</code>を使って、パッケージを切り替えられます:</p>
 
 <pre class="perl prettyprint">
+use strict;
+use warnings;
+
 sub subroutine {
 	print "universe";
 }
 
-our $variable = "empty";
-	
 package Food::Potatoes;
 
 # no collision:
 sub subroutine {
 	print "kingedward";
 }
-
-our $variable = "mashed";
 </pre>
 
-<p class=original>Any time you call a subroutine, you implicitly call a subroutine which is inside the current package. The same is true of package variables. Alternatively, you can explicitly provide a package. See what happens if we continue the above script:</p>
-<p>サブルーチンを呼んだときはいつでも、暗黙に現在のパッケージ内のサブルーチンを呼んでいます。同じことは、パッケージ変数にも言えます。その代わりに、パッケージを明示的に書くこともできます。下のスクリプトを実行したら、何が起きるでしょうか:</p>
+<p class="original"><i>Note the use of the double colon <code>::</code> as a namespace separator.</i></p>
+<p><i>名前空間の区切りに<code>::</code>を使っているのに注意してください</i></p>
 
-<pre class="perl prettyprint">
-subroutine();    # "kingedward"
-print $variable; # "mashed"
+<p class="original">Any time you call a subroutine, you implicitly call a subroutine which is inside the current package. Alternatively, you can explicitly provide a package. See what happens if we continue the above script:</p>
+<p>サブルーチンを呼んだときはいつでも、暗黙に現在のパッケージ内のサブルーチンを呼んでいます。代わりに、パッケージを明示的に書くこともできます。下のスクリプトを実行したら、何が起きるでしょうか:</p>
 
-main::subroutine();              # "universe"
-print $main::variable;           # "empty"
-Food::Potatoes::subroutine();    # "kingedward"
-print $Food::Potatoes::variable; # "mashed"
+<pre class="perl prettyprint">
+subroutine();                 # "kingedward"
+main::subroutine();           # "universe"
+Food::Potatoes::subroutine(); # "kingedward"
 </pre>
 
-<h3 class=original>Modules</h3>
-<h3>モジュール</h3>
+<p class="original">So the logical solution to the problem described above is to modify <code>C:\foo\bar\baz\Demo\StringUtils.pm</code> or <code>/foo/bar/baz/Demo/StringUtils.pm</code> to read:</p>
+<p>ですので、上で述べた問題の論理的な解決策は<code>C:\foo\bar\baz\Demo\StringUtils.pm</code>か<code>/foo/bar/baz/Demo/StringUtils.pm</code>を変更することです:</p>
 
-<p class=original>A <i>module</i> is a <code>.pm</code> file that you can include in another Perl file (script or module). A module is a text file with exactly the same syntax as a <code>.pl</code> Perl script. An example module might be located at <code>C:\foo\bar\baz\Mathematics\Powers.pm</code> or <code>/foo/bar/baz/Mathematics/Powers.pm</code>, and read as follows:</p>
-<p>A <i>モジュール</i>は、他のPerlファイル(スクリプトかモジュール)に含めることが出来る<code>.pm</code>ファイルです。モジュールは <code>.pl</code> Perlスクリプトとまったく同じシンタックのステキストファイルです。例のモジュールは、<code>C:\foo\bar\baz\Mathematics\Powers.pm</code> か <code>/foo/bar/baz/Mathematics/Powers.pm</code>にあります。続きを読んでください:</p>
 <pre class="perl prettyprint">
 use strict;
 use warnings;
 
-package Mathematics::Powers;
-
-our $e = 2.71828;
+<ins>package Demo::StringUtils;</ins>
 
-sub exp {
-	return $e ** shift;
+sub zombify {
+	my $word = shift @_;
+	$word =~ s/[aeiou]/r/g;
+	return $word;
 }
 
-1;
-</pre>
-
-<p class=original>Because a module is executed from top to bottom when it is loaded, you need to return a true value at the end to show that it was loaded successfully. <code>return 1</code> would suffice. If you don't use <code>return</code>, the value returned is <em>the value returned when the most recent statement was evaluated</em>. So, you will often see <code>1</code> at the bottom of a Perl module, as shown above.</p>
-<p>モジュールはロードされると、最初から最後まで実行されるので、ロードが成功したことを示すために、最後に真の値を返す必要があります。<code>return 1</code>で十分です。<code>return</code>を使わなければ、返される値は、<em>直近のステートメントが評価されたときの戻り値</em>になります。そのために、上で見たように、Perlモジュールの最後に<code>1</code>が良く見られることになります。</p>
-
-<p class=original>So that the Perl interpreter can find them, directories containing Perl modules should be listed in your environment variable <code>PERL5LIB</code> beforehand. List the root directory containing the modules, don't list the module directories or the modules themselves:</p>
-<p>Perlインタープリタはそれらを見つけることができるためには、その前に、Perlモジュールが入っているディレクトリが、環境変数<code>PERL5LIB</code>にリストされているべきです。モジュールが入っているルートディレクトリをリストしてください。モジュールのディレクトリやモジュール自身をリストしてはいけません。</p>
-
-<pre class="bash">
-set PERL5LIB=C:\foo\bar\baz;%PERL5LIB%
-</pre>
-<p>or</p>
-<pre class="bash">
-export PERL5LIB=/foo/bar/baz:$PERL5LIB
+return 1;
 </pre>
 
-<p class=original>Once the Perl module is created and <code>perl</code> knows where to look for it, you can use the <code>require</code> built-in function to search for and execute it during a Perl script. For example, calling <code>require Mathematics::Powers</code> causes the Perl interpreter to search each directory listed in <code>PERL5LIB</code> in turn, looking for a file called <code>Mathematics/Powers.pm</code>. After the module has been loaded, the subroutines and variables that were defined there suddenly become available in the main script. Our example script might be called <code>powers.pl</code> and read as follows:</p>
-<p>Perlモジュールが作られて、<code>perl</code>がそれがどこにあるかを知っていれば、組込の<code>require</code>関数を使って探し、Perlのスクリプト中で実行することができます。例えば、<code>require Mathematics::Powers</code>を呼ぶと、Perlインタープリタは<code>PERL5LIB</code>にリストされているディレクトリを順番に、<code>Mathematics/Powers.pm</code>というファイルを探します。モジュールがロードされたら、突然にサブルーチンと変数がメインスクリプトに定義されます。この例のスクリプトを<code>powers.pl</code>と呼びましょう。続けて読んでくさい:</p>
+<p class="original">And modify <code>main.pl</code> to read:</p>
+<p>そして、<code>main.pl</code>を変更します</p>
 
 <pre class="perl prettyprint">
 use strict;
 use warnings;
 
-require Mathematics::Powers;
+require Demo::StringUtils;
 
-print Mathematics::Powers::exp(2); # "7.3890461584"
+print <ins>Demo::StringUtils::</ins>zombify("i want brains"); # "r wrnt brrrns"
 </pre>
 
 <p class=original>Now read this next bit carefully.</p>
 <p>では、次はちょっと注意して読んでください。</p>
-<p class=original>Packages and modules are two completely separate and distinct features of the Perl programming language. The fact that they both use the same double colon delimiter is a monumental red herring. It is possible to switch packages multiple times over the course of a script or module, and it is possible to use the same package declaration in multiple locations in multiple files. Calling <code>require Foo::Bar</code> <em>does not</em> look for and load a file with a <code>package Foo::Bar</code> declaration somewhere inside it. Calling <code>require Foo::Bar</code> <em>does not</em> necessarily load subroutines or package variables in the <code>Foo::Bar</code> namespace. Calling <code>require Foo::Bar</code> merely loads a file called <code>Foo/Bar.pm</code>, which need not have <em>any</em> kind of package declaration inside it at all, and in fact might declare <code>package Baz::Qux</code> and other nonsense inside it for all you know.</p>
-<p>パッケージとモジュールの2つは、プログラミング言語Perlにおいて完全に分かれており、区別された機能です。この2つが同じダブルコロンのデリミタを使っていることは、重要なひっかけです。これは、スクリプトまたはモジュールのコース経由でパッケージを複数回切り替えることができ、また、複数のファイル内の複数の場所で同一のパッケージ宣言を使うこともできます。<code>require Foo::Bar</code>を呼ぶことは<code>Foo::Bar</code>名前空間にあるサブルーチンやパッケージ変数を必ずしもロード<em>しません</em>。<code>require Foo::Bar</code>を呼ぶことは、単に<code>Foo/Bar.pm</code>というファイルをロードするだけであり、そのファイルに、<em>どのような</em>種類のパッケージ宣言も必要有りません。実際には、<code>package Baz::Qux</code>のような
 意味のないものも宣言できます。</p>
+<p class=original>Packages and modules are two completely separate and distinct features of the Perl programming language. The fact that they both use the same double colon delimiter is a monumental red herring. It is possible to switch packages multiple times over the course of a script or module, and it is possible to use the same package declaration in multiple locations in multiple files. Calling <code>require Foo::Bar</code> <em>does not</em> look for and load a file with a <code>package Foo::Bar</code> declaration somewhere inside it, nor does it necessarily load subroutines in the <code>Foo::Bar</code> namespace. Calling <code>require Foo::Bar</code> merely loads a file called <code>Foo/Bar.pm</code>, which need not have <em>any</em> kind of package declaration inside it at all, and in fact might declare <code>package Baz::Qux</code> and other nonsense inside it for all you know.</p>
+<p>パッケージとモジュールの2つは、プログラミング言語Perlにおいて完全に分かれており、区別された機能です。この2つが同じダブルコロンのデリミタを使っていることは、重要なひっかけです。これは、スクリプトまたはモジュールのコース経由でパッケージを複数回切り替えることができ、また、複数のファイル内の複数の場所で同一のパッケージ宣言を使うこともできます。<code>require Foo::Bar</code>を呼ぶことは<code>Foo::Bar</code>名前空間にあるサブルーチンやパッケージ変数を必ずしもロード<em>しません</em>し、<code>Foo::Bar</code>名前空間のサブルーチンを必ずしもロードするわけではありません。<code>require Foo::Bar</code>を呼ぶことは、単に<code>Foo/Bar.pm</code>というファイルをロードするだけであり、そのファイルに、<em>どのような<
 /em>種類のパッケージ宣言も必要有りません。実際には、<code>package Baz::Qux</code>のようなナンセンスな宣言もできます。</p>
 
 <p class=original>Likewise, a subroutine call <code>Baz::Qux::processThis()</code> need not necessarily have been declared inside a file named <code>Baz/Qux.pm</code>. It could have been declared <em>literally anywhere</em>.</p>
 <p>その上、<code>Baz::Qux::processThis()</code>のサブルーチン呼び出しは、<code>Baz/Qux.pm</code>という名前のファイル内に宣言されている必要すらありません。<em>文字通り、どこにでも</em>定義することができます。</p>
@@ -1650,35 +1670,39 @@
 <p>この2つのコンセプトを分けてしまったことは、Perlの最も愚かな特徴の1つであり、これら2つのコンセプトを分けて取り扱ってしまうと常に、カオスで気の狂ったようなコードとなります。幸運なことに、Perlプログラマの多くは、次の2つの規則に従っています:</p>
 <ol class="original">
 	<li><strong>A Perl script (<code>.pl</code> file) must always contain exactly zero <code>package</code> declarations.</strong></li>
-	<li><strong>A Perl module (<code>.pm</code> file) must always contain exactly one <code>package</code> declaration, corresponding exactly to its name and location.</strong> E.g. module <code>Mathematics/Powers.pm</code> must begin with <code>package Mathematics::Powers</code>.</li>
+	<li><strong>A Perl module (<code>.pm</code> file) must always contain exactly one <code>package</code> declaration, corresponding exactly to its name and location.</strong> E.g. module <code>Demo/StringUtils.pm</code> must begin with <code>package Demo::StringUtils</code>.</li>
 </ol>
 <ol>
 	<li><strong>Perlスクリプト(<code>.pl</code>ファイル)は、1つの<code>package</code>宣言も含まない。</strong></li>
-	<li><strong>Perlモジュール(<code>.pm</code>ファイル)は、1つの<code>package</code>宣言を含み、名前と場所が一致している。</strong> 例: モジュール<code>Mathematics/Powers.pm</code>は、<code>package Mathematics::Powers</code>で始まっている。</li>
+	<li><strong>Perlモジュール(<code>.pm</code>ファイル)は、1つの<code>package</code>宣言を含み、名前と場所が一致している。</strong> 例: モジュール<code>Demo/StringUtils.pm</code>は、<code>package Demo::StringUtils</code>で始まっている。</li>
 </ol>
 
 <p class="original">Because of this, in practice you will find that most "packages" and "modules" produced by reliable third parties <em>can</em> be regarded and referred to interchangeably. However, it is important that you do not take this for granted, because one day you <em>will</em> meet code produced by a madman.</p>
 <p>これにより, 信頼できるサードパーティに作られた、ほとんどの"packages"と"modules"を見つけることができ、相互に関係し参照され<em>うる</em>。しかし、これが当たり前と思わないことは重要です。いつか、常軌を逸した人が作ったコードに出会う<em>でしょう</em>。</p>
 
-<h2 class="oritingal">Object-oriented Perl</h2>
+<h2 class="original">Object-oriented Perl</h2>
 <h2>オブジェクト指向Perl</h2>
 
 <p class="orignal">Perl is not a great language for OO programming. Perl's OO capabilities were grafted on after the fact, and this shows.</p>
 <p>PerlはOOプログラミングに、あまり適した言語ではありません。 PerlのOO能力は後付のものです。それは、</p>
 
-<ul class="original">
-	<li><p>An <i>object</i> is simply a reference (i.e. a scalar variable) which happens to know which class its referent belongs to. To tell a reference that its referent belongs to a class, use <code>bless</code>. To find out what class a reference's referent belongs to (if any), use <code>ref</code>.</p></li>
-	<li><p>A <i>method</i> is simply a subroutine that expects an object (or, in the case of class methods, a package name) as its first argument. Object methods are invoked using <code>$obj-&gt;method()</code>; class methods are invoked using <code>Package::Name-&gt;method()</code>.</p></li>
-	<li><p>A <i>class</i> is simply a package that happens to contain methods.</p></li>
-</ul>
 <ul>
-	<li><p><i>オブジェクト</i>は単純に、どのクラスに属しているかを示しているリファレンスです(i.e. スカラ変数)。そのリファレントがクラスに属していることをリファレンスに教えるために、<code>bless</code>を使います。blessにより、どのクラスがどのリファレントに属するのかを分かるようになります。リファレンスのリファレントがどのクラスに属しているかをみつけるためには、<code>ref</code>を使います</p></li></li>
-	<li><p><i>メソッド</i>は単純に第一引数オブジェクト(または、クラスメソッドであれば、パッケージ名)であるサブルーチンです。オブジェクトメソッドは、<code>$obj-&gt;method()</code>を使って呼び出されます; クラスメソッドは<code>Package::Name-&gt;method()</code>です。</p></li>
-	<li><p><i>クラス</i>は単純にメソッドを含むパッケージです。</p></li>
+	<li>
+        <p class="original">An <i>object</i> is simply a reference (i.e. a scalar variable) which happens to know which class its referent belongs to. To tell a reference that its referent belongs to a class, use <code>bless</code>. To find out what class a reference's referent belongs to (if any), use <code>ref</code>.</p>
+        <p><i>オブジェクト</i>は単純に、どのクラスに属しているかを示しているリファレンスです(i.e. スカラ変数)。そのリファレントがクラスに属していることをリファレンスに教えるために、<code>bless</code>を使います。blessにより、どのクラスがどのリファレントに属するのかを分かるようになります。リファレンスのリファレントがどのクラスに属しているかをみつけるためには、<code>ref</code>を使います</p>
+        </li>
+	<li>
+        <p class="original">A <i>method</i> is simply a subroutine that expects an object (or, in the case of class methods, a package name) as its first argument. Object methods are invoked using <code>$obj-&gt;method()</code>; class methods are invoked using <code>Package::Name-&gt;method()</code>.</p>
+        <p><i>メソッド</i>は単純に第一引数オブジェクト(または、クラスメソッドであれば、パッケージ名)であるサブルーチンです。オブジェクトメソッドは、<code>$obj-&gt;method()</code>を使って呼び出されます; クラスメソッドは<code>Package::Name-&gt;method()</code>です。</p>
+        </li>
+	<li>
+        <p class="original">A <i>class</i> is simply a package that happens to contain methods.</p>
+        <p><i>クラス</i>は単純にメソッドを含むパッケージです。</p>
+        </li>
 </ul>
 
-<p class="original">A quick example. An example module <code>Animals/Animals.pm</code> containing a class <code>Animals::Animal</code> reads like this:</p>
-<p>以下、簡単な例です。 例として、<code>Animal</code>クラスを含むモジュール<code>Animal.pm</code>は、次のようになります:</p>
+<p class="original">A quick example makes this clearer. An example module <code>Animal.pm</code> containing a class <code>Animal</code> reads like this:</p>
+<p>以下、簡単な例でそれをはっきりさせます。 例のモジュールとして<code>Animal.pm</code>のクラス<code>Animal</code>は、次のようになります:</p>
 
 <pre class="perl prettyprint">
 use strict;
@@ -1688,10 +1712,10 @@
 
 sub eat {
 	# First argument is always the object to act upon.
-	my $self = shift;
-	
+	my $self = shift @_;
+
 	foreach my $food ( @_ ) {
-		if($self-&gt;canEat($food)) {
+		if($self-&gt;can_eat($food)) {
 			print "Eating ", $food;
 		} else {
 			print "Can't eat ", $food;
@@ -1700,52 +1724,51 @@
 }
 
 # For the sake of argument, assume an Animal can eat anything.
-sub canEat {
+sub can_eat {
 	return 1;
 }
 
-1;
+return 1;
 </pre>
 
-<p class="original">And a Perl script making use of this class might read:</p>
-<p>このクラスを使うPerlスクリプトは次のようになるでしょう:</p>
+<p class="original">And we might make use of this class like so:</p>
+<p>このクラスを使う次のように使うでしょう:</p>
 
 <pre class="perl prettyprint">
-use strict;
-use warnings;
-
 require Animal;
 
-my $animal = {};                  # $animal is an ordinary hash reference
-print ref $animal;                # "HASH"
-bless $animal, "Animals::Animal"; # now it is an object of class "Animal"
-print ref $animal;                # "Animal"
-
-$animal-&gt;eat("insects", "curry", "salmon");
+my $animal = {
+	"legs"   =&gt; 4,
+	"colour" =&gt; "brown",
+};                       # $animal is an ordinary hash reference
+print ref $animal;       # "HASH"
+bless $animal, "Animal"; # now it is an object of class "Animal"
+print ref $animal;       # "Animal"
 </pre>
 
-<p class="original">This final call is equivalent to <code>Animals::Animal::eat($animal, "insects", "curry", "salmon")</code>.</p>
-<p>最後の呼び出しは、<code>Animals::Animal::eat($animal, "insects", "curry", "salmon")</code>と同じです。</p>
-
 <p class="original">Note: literally any reference can be blessed into any class. It's up to you to ensure that (1) the referent can actually be used as an instance of this class and (2) that the class in question exists and has been loaded.</p>
 <p>注意: 文字通り、どのようなリファレンスも、どのようなクラスにでもblessされえます。(1)リファレンスが実際にそのクラスのインスタンスとして使われているかと、(2)問題のクラスが存在し、ロードされているかを保証するのはあなた次第です。</p>
 
 <p class="original">You can still work with the original hash in the usual way:</p>
+<p>まだ、通常のやり方でオリジナルのハッシュを操作できます</p>
 <pre class="perl prettyprint">
 print "Animal has ", $animal->{"legs"}, " leg(s)";
 </pre>
-<p class="original">You can also call methods on the object using the same -> operator, like so:</p>
+
+<p class="original">You can also call methods on the object using the same <code>-&gt;</code> operator, like so:</p>
+<p>同じ<code>-&gt;</code>オペレータでオブジェクトからメソッドを呼ぶことができます:</p>
 <pre class="perl prettyprint">
-$animal->eat("insects", "curry", "eucalyptus");
+$animal-&gt;eat("insects", "curry", "eucalyptus");
 </pre>
-<p class="original">This final call is equivalent to Animal::eat($animal, "insects", "curry", "eucalyptus").</p>
+<p class="original">This final call is equivalent to <code>Animal::eat($animal, "insects", "curry", "eucalyptus")</code>.</p>
+<p>最後の呼び出しは、<code>Animal::eat($animal, "insects", "curry", "eucalyptus")</code>と同じです。</p>
 
 <h3 class="original">Constructors</h3>
 <h3>コンストラクタ</h3>
 
 <p class=original>A constructor is a class method which returns a new object. If you want one, just declare one. You can use any name you like. For class methods, the first argument passed is not an object but a class name. In this case, <code>"Animal"</code>:</p>
 <p>コンストラクタはクラスメソッドで、新しいオブジェクトを返します。コンストラクタが欲しければ、それを宣言するだけです。好きな名前を使えます。クラスメソッドには、最初の引数として、オブジェクトではなくクラス名が渡ります。このケースでは、<code>"Animal"</code>です:</p>
-<pre class="perl">
+<pre class="perl prettyprint">
 use strict;
 use warnings;
 
@@ -1761,7 +1784,7 @@
 
 <p class=original>And then use it like so:</p>
 <p>次のように使います:</p>
-<pre class="perl">
+<pre class="perl prettyprint">
 my $animal = Animal-&gt;new();
 </pre>
 
@@ -1792,19 +1815,6 @@
 return 1;
 </pre>
 
-<p>And some sample code:</p>
-
-<pre class="perl">
-use strict;
-use warnings;
-
-require Koala;
-
-my $koala = Koala-&gt;new();
-
-$koala-&gt;eat("insects", "curry", "eucalyptus"); # eat only the eucalyptus
-</pre>
-
 <p class="original">And some sample code:</p>
 <p>サンプルコード:</p>
 
@@ -1819,8 +1829,8 @@
 $koala-&gt;eat("insects", "curry", "eucalyptus"); # eat only the eucalyptus
 </pre>
 
-<p class="original">This final method call tries to invoke <code>Koala::eat($bear, "insects", "curry", "eucalyptus")</code>, but a subroutine <code>eat()</code> isn't defined in the <code>Koala</code> package. However, because <code>@ISA</code> has been populated with a parent package <code>Animal</code>, the Perl interpreter tries calling <code>Animal::eat($bear, "insects", "curry", "eucalyptus")</code> instead, which works. Note how the class <code>Animal</code> had to be loaded explicitly by <code>Koala</code>.</p>
-<p>最後のメソッド呼び出しは、<code>Koala::eat($bear, "insects", "curry", "eucalyptus")</code>を呼ぼうとしますが、サブルーチン<code>eat()</code>は、<code>Koala</code> パッケージには定義されていません。ですが、<code>@Koala::ISA</code>にパッケージ<code>Animal</code>があるので、Perlインタプリタは <code>Animal::eat($bear, "insects", "curry", "eucalyptus")</code>を代わりに呼ぼうとして、代わりにそれは動きます。次のことに注意してください。クラス<code>Animal</code>は<code>Koala</code>で明示的にロードされていなければいけません。</p>
+<p class="original">This final method call tries to invoke <code>Koala::eat($koala, "insects", "curry", "eucalyptus")</code>, but a subroutine <code>eat()</code> isn't defined in the <code>Koala</code> package. However, because <code>@Koala::ISA</code> has been populated with a parent class <code>Animal</code>, the Perl interpreter tries calling <code>Animal::eat($koala, "insects", "curry", "eucalyptus")</code> instead, which works. Note how the class <code>Animal</code> had to be loaded explicitly by <code>Koala.pm</code>.</p>
+<p>最後のメソッド呼び出しは、<code>Koala::eat($koala, "insects", "curry", "eucalyptus")</code>を呼ぼうとしますが、サブルーチン<code>eat()</code>は、<code>Koala</code> パッケージには定義されていません。ですが、<code>@Koala::ISA</code>に親クラス<code>Animal</code>があるので、Perlインタプリタは <code>Animal::eat($koala, "insects", "curry", "eucalyptus")</code>を代わりに呼ぼうとして、代わりにそれは動きます。次のことに注意してください。クラス<code>Animal</code>は<code>Koala.pm</code>で明示的にロードされていなければいけません。</p>
 <p class="original">Since <code>@ISA</code> is an array, Perl supports multiple inheritance, with all the benefits and horrors this entails.</p>
 <p><code>@ISA</code> は配列なので、Perl は多重継承をサポートします。全ての利益と恐怖を伴いますが。</p>
 
@@ -1848,8 +1858,7 @@
 <p class="original">A <code>BEGIN</code> block is always executed first. If you create multiple <code>BEGIN</code> blocks (don't), they are executed in order from top to bottom as the compiler encounters them. A <code>BEGIN</code> block always executes first even if it is placed halfway through a script (don't do this) or even at the end (or this).</p>
 <p><code>BEGIN</code>ブロックは常にさいs鬼実行されます。複数の<code>BEGIN</code>ブロックを書くと(don't)、 上から順番にコンパイラがそれらに出会う順番に実行されます。<code>BEGIN</code>ブロックは常に最初に実行されます。もし、BEGINブロックがスクリプトの途中(そんなことはしないでください)や、最後(or this)に書かれていたりしてさえも。</p>
 <p class="original">Because they are executed at compilation time, a <code>BEGIN</code> block placed inside a conditional block will <em>still</em> be executed first, even if the conditional evaluates to false and despite the fact that the conditional <em>has not been evaluated at all yet</em> and in fact <em>may never be evaluated</em>. <strong>Do not put <code>BEGIN</code> blocks in conditionals!</strong> If you want to do something conditionally at compile time, you need to put the conditional <em>inside</em> the <code>BEGIN</code> block:</p>
-<p>コンパイル時に実行されるので、<code>BEGIN</code>ブロックが条件ブロックの中にあっても、<em>まだ</em>最初に実行されます。たとえ、条件の評価が偽であり、条件が<em>まだまったく評価されていない</em>にもかかわらず、実際には、<em>評価されることがない</em>としてもです。
-<strong><code>BEGIN</code>ブロックを条件の中に置いては行けません!</strong> コンパイル時に何かしらの条件付きのことがしたければ、<code>BEGIN</code>ブロックの<em>中に</em>条件文を置かなければなりません:</p>
+<p>コンパイル時に実行されるので、<code>BEGIN</code>ブロックが条件ブロックの中にあっても、<em>まだ</em>最初に実行されます。たとえ、条件の評価が偽であり、条件が<em>まだまったく評価されていない</em>にもかかわらず、実際には、<em>評価されることがない</em>としてもです。<strong><code>BEGIN</code>ブロックを条件の中に置いては行けません!</strong> コンパイル時に何かしらの条件付きのことがしたければ、<code>BEGIN</code>ブロックの<em>中に</em>条件文を置かなければなりません:</p>
 <pre class="perl prettyprint">
 BEGIN {
 	if($condition) {
@@ -1864,37 +1873,37 @@
 <p class="original">The following three statements:</p>
 <p>以下の3つのステートメントは:</p>
 <pre class="perl prettyprint">
-use Bugs::Caterpillar ("crawl", "pupate");
-use Bugs::Caterpillar ();
-use Bugs::Caterpillar;
+use Caterpillar ("crawl", "pupate");
+use Caterpillar ();
+use Caterpillar;
 </pre>
 <p class="original">are respectively equivalent to:</p>
 <p>以下とそれぞれ等価です:</p>
 <pre class="perl prettyprint">
 BEGIN {
-	require Bugs::Caterpillar;
-	Bugs::Caterpillar-&gt;import("crawl", "pupate");
+	require Caterpillar;
+	Caterpillar-&gt;import("crawl", "pupate");
 }
 BEGIN {
-	require Bugs::Caterpillar;
+	require Caterpillar;
 }
 BEGIN {
-	require Bugs::Caterpillar;
-	Bugs::Caterpillar-&gt;import();
+	require Caterpillar;
+	Caterpillar-&gt;import();
 }
 </pre>
 <ul class="original">
 	<li>No, the three examples are not in the wrong order. It is just that Perl is dumb.</li>
 	<li>A <code>use</code> call is a disguised <code>BEGIN</code> block. The same caveats apply. <code>use</code> statements must always be placed at the top of the file, and <strong>never inside conditionals</strong>.</li>
-	<li><code>import()</code> is not a built-in Perl function. It is a <strong>user-defined class method</strong>. The burden is on the programmer of the <code>Bugs::Caterpillar</code> package to define or inherit <code>import()</code>, and the method could theoretically accept anything as arguments and do anything with those arguments.</li>
-	<li>Notice how <code>require Bugs::Caterpillar</code> loads a <strong>module</strong> named <code>Bugs/Caterpillar.pm</code>, whereas <code>Bugs::Caterpillar-&gt;import()</code> calls the <code>import()</code> subroutine that was defined inside the <code>Bugs::Caterpillar</code> <strong>package</strong>. Let's hope the module and the package coincide!</li>
+	<li><code>import()</code> is not a built-in Perl function. It is a <strong>user-defined class method</strong>. The burden is on the programmer of the <code>Caterpillar</code> package to define or inherit <code>import()</code>, and the method could theoretically accept anything as arguments and do anything with those arguments. Consult the documentation of <code>Caterpillar.pm</code> to find out exactly what will happen.</li>
+	<li>Notice how <code>require Caterpillar</code> loads a <strong>module</strong> named <code>Caterpillar.pm</code>, whereas <code>Caterpillar-&gt;import()</code> calls the <code>import()</code> subroutine that was defined inside the <code>Caterpillar</code> <strong>package</strong>. Let's hope the module and the package coincide!</li>
 </ul>
 
 <ul>
 	<li>いいえ、3つの例は間違った順番ではありません。Perlが馬鹿なだけです。</li>
 	<li><code>use</code>の呼び出しは<code>BEGIN</code>ブロックに変換されます。同じ警告が適用されます。<code>use</code>ステートメントはファイルの最初に置かれなければいけません。<strong>条件の中に置いてはいけません</strong>。</li>
-	<li><code>import()</code> はPerlの組込の関数ではありません。<strong>ユーザー定義のクラスメソッドです</strong>。<code>import()</code>を定義するか、継承するかの義務は<code>Bugs::Caterpillar</code>パッケージのプログラマにあり、メソッドは理論上、どのような引数でも受け入れ、どのようなことでもできます。</li>
-	<li><code>require Bugs::Caterpillar</code>が<code>Bugs/Caterpillar.pm</code>という名前の<strong>module</strong>をロードすることに注意してください。<code>Bugs::Caterpillar-&gt;import()</code>は、<code>Bugs::Caterpillar</code> <strong>package</strong>内に定義された<code>import()</code>サブルーチンを呼びます。モジュールとパッケージが一致していることを期待しましょう!</li>
+	<li><code>import()</code> はPerlの組込の関数ではありません。<strong>ユーザー定義のクラスメソッドです</strong>。<code>import()</code>を定義するか、継承するかの義務は<code>Caterpillar</code>パッケージのプログラマにあり、メソッドは理論上、どのような引数でも受け入れ、どのようなことでもできます。<code>Captepillar.pm</code>のドキュメントを読んで、何が起きるか正確に調査してください。</li>
+	<li><code>require Caterpillar</code>が<code>Caterpillar.pm</code>という名前の<strong>module</strong>をロードすることに注意してください。<code>Caterpillar-&gt;import()</code>は、<code>Caterpillar</code> <strong>package</strong>内に定義された<code>import()</code>サブルーチンを呼びます。モジュールとパッケージが一致していることを期待しましょう!</li>
 </ul>
 
 <h2>Exporter</h2>
@@ -1902,7 +1911,7 @@
 <p class="original">The most common way to define an <code>import()</code> method is to inherit it from the <a href="http://perldoc.perl.org/Exporter.html">Exporter</a> module. Exporter is a core module, and a <i>de facto</i> core feature of the Perl programming language. In Exporter's implementation of <code>import()</code>, the list of arguments that you pass in is interpreted as a list of subroutine names. When a subroutine is <code>import()</code>ed, it becomes available in the current package as well as in its own original package.</p></p>
 
 <p><code>import()</code>メソッドを定義する常識的な方法は Exporter モジュールから継承することです。Exporter はコアモジュールで、プログラミング言語Perlの<i>デファクト</i>のコアの機能です。Exporterの<code>import</code>の実装で、渡した引数のリストは、サブルーチンの名前として解釈されます。サブルーチンが<code>import()</code>されると、現在の名前空間で、そのオリジナルの名前空間にあるかのと同じように、利用可能になります。</p>
-<p class="original">This concept is easiest to grasp using an example. Here's what <code>Bugs/Caterpillar.pm</code> looks like:</p>
+<p class="original">This concept is easiest to grasp using an example. Here's what <code>Caterpillar.pm</code> looks like:</p>
 <p>このコンセプトは例を使うと把握しやすいでしょう。<code>Caterpillar.pm</code>は次のようなものです:</p>
 
 <pre class="perl prettyprint">
@@ -1925,7 +1934,7 @@
 </pre>
 
 <p class="original">And here's a script which makes use of the <code>Caterpillar.pm</code> module:</p>
-<p><code>Bugs/Caterpillar.pm</code>モジュールを使ったスクリプトです:</p>
+<p><code>Caterpillar.pm</code>モジュールを使ったスクリプトです:</p>
 
 <pre class="perl prettyprint">
 use strict;
@@ -1942,107 +1951,77 @@
 
 <p class="original">The package variable <code>@EXPORT_OK</code> can be populated with a list of all subroutines which the user can import explicitly by passing subroutine names to <code>import()</code>. If <code>import()</code> is called with the name of a subroutine not in this list, a runtime error will occur. For example, try <code>use Caterpillar ("pupate")</code>.</p>
 
-<p>パッケージ変数<code>@EXPORT</code>はデフォルトでエクスポートされるサブルーチンのリストを入れます。<code>import()</code> が引数なしで呼ばれた場合に、この例で起きることが起きます。<code>import()</code>がリストに存在しない名前と一緒によばれたら、実行時エラーが起きます。試しに<code>use Caterpillar ("pupate")</code>を試してみてください。</p>
+<p>パッケージ変数<code>@EXPORT_OK</code>はユーザーが、<code>import()</code>に渡せる、インポート出来る全てのサブルーチンのリストが入れられます。もし、<code>import()</code>がリストに存在しない名前と一緒によばれたら、実行時エラーが起きます。試しに<code>use Caterpillar ("pupate")</code>を試してみてください。</p>
+
+<p class="original">The package variable <code>@EXPORT</code> can be populated with a list of subroutines to be exported by default. These are exported if <code>import()</code> is called with no arguments at all, which is what happens in this example.</p>
+<p>パッケージ変数<code>@EXPORT</code>はデフォルトでエクスポートされるサブルーチンのリストを入れます。<code>import()</code> が引数なしで呼ばれた場合に、この例で起きることが起きます。</p>
 
 <p class=original>>As a result of being <code>import()</code>ed, a method such as <code>Caterpillar::crawl()</code> become available without qualification as <code>crawl()</code>. This saves typing. (Note: regardless of the content of <code>@EXPORT_OK</code>, every method can always be called "longhand", as shown above. There are no private methods in Perl. Customarily, a method intended for private use is named with a leading underscore or two.)</p>
 
 <p><code>import()</code>された結果として、<code>Caterpillar::crawl()</code>のようなメソッドが<code>crawl()</code>のように、修飾なしに利用可能になります。これは、タイプ数の節約になります。(注意: <code>@EXPORT_OK</code>のコンセプトにかかわらず、 全てのメソッドは、上で見たように、"longhand"で呼ぶことが出来ます。 Perlにはプライベートメソッドはありません。通例、1つか2つのアンダースコアから始まる名前が付けられたメソッドはプライベートを意図します。</p>
 
-<p class="original"><strong>A caution.</strong> Notice how <code>crawl()</code> was neither defined in the script, nor explicitly <code>import()</code>ed from another file with e.g. <code>use Caterpillar ("crawl")</code>. Suppose the middle three lines weren't there to provide clues, and suppose there were a dozen <code>use</code> calls alongside <code>use Caterpillar</code>. And remember that any module is free to have more <code>use</code> calls of its own. In such a situation, it is extremely difficult to locate the place where <code>crawl()</code> was originally defined. The moral of this story is twofold:</p>
+<p class="original">Note how, again, we are back in a situation where without other clues it might not be easy to tell where <code>crawl()</code> was originally defined. The moral of this story is twofold:</p>
+<p>再度注意しておくと、他のものないシチュエーションに戻ると、<code>crawl()</code>が元々どこで定義されていたのかを教えるのは簡単ではありません。この話の教訓は2つあります:</p>
 
-<p><strong>注意。</strong><code>crawl()</code>はスクリプトで定義されておらず、明示的に他のファイルから<code>import()</code>されました。e.g. <code>use Caterpillar ("crawl")</code>。真ん中の3行のようにヒントを提供せず、<code>use Caterpillar</code>と並行して、12の<code>use</code>呼び出しがあったとすると。 また、どのモジュールも自由に複数の<code>use</code>呼び出しをそれ自身でできることを思い起こすと。このような状況では、
-<code>crawl()</code>が元々定義されている場所を見つけるのは容易ではありません。この話の教訓は2つあります:</p>
-
-<ol class="original">
-<li><p>When creating a module which makes use of Exporter, never use <code>@EXPORT</code> to export subroutines by default. Always make the user call subroutines "longhand" or <code>import()</code> them explicitly (using e.g. <code>use Caterpillar ("crawl")</code>, which is a strong clue to look in <code>Bugs/Caterpillar.pm</code> for the definition of <code>crawl()</code>).</p></li>
-<li><p>When <code>use</code>ing a module, always explicitly name the subroutines you want to <code>import()</code>. If you don't want to <code>import()</code> any subroutines and wish to refer to them longhand, you must supply an explicit empty list: <code>use Caterpillar ()</code>.</p></li>
-</ol>
-
-<ol class="original">
-<li><p>When creating a module which makes use of Exporter, never use <code>@EXPORT</code> to export subroutines by default. Always make the user call subroutines "longhand" or <code>import()</code> them explicitly (using e.g. <code>use Caterpillar ("crawl")</code>, which is a strong clue to look in <code>Bugs/Caterpillar.pm</code> for the definition of <code>crawl()</code>).</p></li>
-<li><p>When <code>use</code>ing a module, always explicitly name the subroutines you want to <code>import()</code>. If you don't want to <code>import()</code> any subroutines and wish to refer to them longhand, you must supply an explicit empty list: <code>use Caterpillar ()</code>.</p></li>
-</ol>
 <ol>
-<li><p>Exporterを使うモジュールを作る際には、デフォルトでサブルーチンをエクスポートする<code>@EXPORT</code>を使わないこと。常に、ユーザーに、"longhand"でサブルーチンを呼ばせるか、明示的に<code>import()</code>させること(e.g. <code>use Caterpillar ("crawl")</code>を使って。<code>Bugs/Caterpillar.pm</code>に<code>crawl()</code>)の定義があるという強いヒントになります。</p></li>
-<li><p>モジュールを<code>use</code>すると、常に明示的に<code>import()</code>したいサブルーチンの名前書きます。何のサブルーチンも<code>import()</code>したくなく、longhandで参照したいのなら、からのリストを提供しなければいけません。: <code>use Caterpillar ()</code>.</p></li>
+<li>
+    <p class="original">When creating a module which makes use of Exporter, never use <code>@EXPORT</code> to export subroutines by default. Always make the user call subroutines "longhand" or <code>import()</code> them explicitly (using e.g. <code>use Caterpillar ("crawl")</code>, which is a strong clue to look in <code>Caterpillar.pm</code> for the definition of <code>crawl()</code>).</p>
+    <p>Exporterを使うモジュールを作る際には、デフォルトでサブルーチンをエクスポートする<code>@EXPORT</code>を使わないこと。常に、ユーザーに、"longhand"でサブルーチンを呼ばせるか、明示的に<code>import()</code>させること(e.g. <code>use Caterpillar ("crawl")</code>を使って。<code>Caterpillar.pm</code>に<code>crawl()</code>)の定義があるという強いヒントになります。</p>
+</li>
+<li>
+    <p class="original">When <code>use</code>ing a module which makes use of Exporter, always explicitly name the subroutines you want to <code>import()</code>. If you don't want to <code>import()</code> any subroutines and wish to refer to them longhand, you must supply an explicit empty list: <code>use Caterpillar ()</code>.</p>
+    <p>モジュールを<code>use</code>すると、常に明示的に<code>import()</code>したいサブルーチンの名前書きます。何のサブルーチンも<code>import()</code>したくなく、longhandで参照したいのなら、からのリストを提供しなければいけません。: <code>use Caterpillar ()</code>.</p></li>
 </ol>
 
-
 <h2 class="original">Miscellaneous notes</h2>
 <h2>その他の注意</h2>
-<p class="original">Perl provides a wide selection of quote-like operators in addition to what you've seen in these documents:</p>
-<p>Perlはクォートの代わりをする演算子の、すでにこのドキュメント内で見ているものに加えて、多くの選択肢を提供しています:</p>
-<ul class="original">
+<ul>
 	<li>
-		<p>There's an alternate syntax, <code>qw{ }</code>, for declaring arrays. This often seen in <code>use</code> statements:</p>
-<pre class="perl prettyprint">
-use Account qw{create open close suspend delete};
-</pre>
+		<p class="original">The core module <a href="http://perldoc.perl.org/Data/Dumper.html">Data::Dumper</a> can be used to output an arbitrary scalar variable to the screen. This is an essential debug tool.</p>
+		<p>コアモジュール<a href="http://perldoc.perl.org/Data/Dumper.html">Data::Dumper</a>は任意のスカラの値をスクリーンに出力するのに使えます。これは基本的なデバッグツールです。</p>
 	</li>
 	<li>
-		<p><code>qr//</code> can be used to put a regex into a scalar variable. This is especially useful because recompiling a regular expression multiple times actually takes substantial time:</p>
+		<p class="original">There's an alternate syntax, <code>qw{ }</code>, for declaring arrays. This is often seen in <code>use</code> statements:</p>
+		<p>配列を宣言するための代わりのシンタックス、<code>qw{ }</code>があります。<code>use</code>ステートメントでよく見られます:</p>
 <pre class="perl prettyprint">
-my @capitals = ("Baton Rouge", "Indianapolis", "Columbus", "Montgomery", "Helena", "Denver", "Boise");
-my $regex = qr/^[B-H]/;
-print join ", ", grep /$regex/, @capitals;
+use Account qw{create open close suspend delete};
 </pre>
+		<p class="original">There are <a href="http://perldoc.perl.org/perlop.html#Quote-and-Quote-like-Operators">many other quote-like operators</a>.</p>
+		<p><a href="http://perldoc.perl.org/perlop.html#Quote-and-Quote-like-Operators">多くの他のクォートライクなオペレータがあります</a>。</p>
 	</li>
 	<li>
-		<p><code>qx{ }</code> can be used instead of `backticks` to invoke a program and capture its output:</p>
-<pre class="perl prettyprint">
-my $text = qx{perl anotherscript.pl foo bar baz};
-</pre>
+		<p class="original">In <code>=~ m//</code> and <code>=~ s///</code> operations, you can use braces instead of slashes as the regex delimiters. This is quite useful if your regex contains a lot of slashes, which would otherwise need escaping with backslashes. For example, <code>=~ m{///}</code> matches three literal forward slashes, and <code>=~ s{^https?://}{}</code> removes the protocol part of a URL.</p>
+		<p><code>=~ m//</code> と <code>=~ s///</code> 演算子で、正規表現の区切り文字にスラッシュの代わりにブレースを使えます。これは、正規表現が多くのスラッシュやバックスラッシュを含む場合に、非常に有用です。例えば、<code>m{///}</code>は、前方の3文字のスラッシュにマッチします。また、<code>=~ s{^https?://}{}</code> は、URLからプロトコル部分を削除します。</p>
 	</li>
 	<li>
-		<p>And many more!</p>
+		<p class="original">Perl does have <code>CONSTANTS</code>. These are discouraged now, but weren't always. Constants are actually just subroutine calls with omitted brackets.</p>
+                <p>Perlには<code>定数</code>があります。 気落ちするようなものですが、常にではありません。定数は実際には、ブラケットを省略したただのサブルーチン呼び出しです。</p>
 	</li>
-</ul>
-<ul>
 	<li>
-		<p>代わりのシンタックスとして、<code>qw{ }</code>が、配列の宣言のためにあります。<code>use</code>ステートメントでよく見られます:</p>
-<pre class="perl prettyprint">
-use Account qw{create open close suspend delete};
-</pre>
+		<p class="original">Sometimes people omit quotes around hash keys, writing <code>$hash{key}</code> instead of <code>$hash{"key"}</code>. They can get away with it because in this situation the bareword <code>key</code> occurs as the string <code>"key"</code>, as opposed to a subroutine call <code>key()</code>.</p>
+                <p>時々、ハッシュのキーでクォートを省略して、<code>$hash{key}</code>を<code>$hash{"key"}</code>の代わりに使います。この状況では、裸の<code>key</code>は、<code>"key"</code>になるからです。<code>key()</code>のようにすると、サブルーチン呼び出しになります。</p>
 	</li>
 	<li>
-		<p><code>qr//</code>は正規表現をスカラ変数に置くのに使われます。これは非常に便利です。なぜなら、正規表現の再コンパイルには時間がかかるからです:</p>
-<pre class="perl prettyprint">
-my @capitals = ("Baton Rouge", "Indianapolis", "Columbus", "Montgomery", "Helena", "Denver", "Boise");
-my $regex = qr/^[B-H]/;
-print join ", ", grep /$regex/, @capitals;
-</pre>
+		<p class="original">If you see a block of unformatted code wrapped in a delimiter with double chevrons, like <code><a href="http://perldoc.perl.org/perlop.html#Quote-and-Quote-like-Operators">&lt;&lt;EOF</a></code>, the magic word to Google for is "here-doc".</p>
+                <p>like <code><a href="http://perldoc.perl.org/perlop.html#Quote-and-Quote-like-Operators">&lt;&lt;EOF</a></code>のように、2つの山括弧で区切られてラップされた整理されていないコードのブロックを見たら、Google検索のためのマジックワードは"ヒアドキュメント(here-doc)"です。</p>
 	</li>
 	<li>
-		<p><code>qx{ }</code>は `バッククォート`の代わりに使われます。 プログラムを実行し、その出力をキャプチャします:</p>
+		<p class="original">Warning! Many built-in functions can be called with no arguments, <strong>causing them to operate on <code>$_</code> instead</strong>. Hopefully this will help you understand formations like:</p>
+                <p>注意! 多くの組込関数では、引数なしで呼ぶと<strong><code>$_</code>が代わりに渡されます</strong>。願わくば、次のような形を理解する助けになれば良いのですが:</p>
 <pre class="perl prettyprint">
-my $text = qx{perl anotherscript.pl foo bar baz};
+print foreach @array;
 </pre>
-	</li>
-	<li>
-		<p>さらにもっと!</p>
-	</li>
-</ul>
-<p class="original">Instead of braces, you can use any character you like as the delimiter in these alternate quote-like operators, as well as in <code>m//</code> regex matches and <code>s///</code> regex replacements. This is actually quite useful if your regex contains a lot of slashes or backslashes. For example, <code>m!///!</code> matches three literal forward slashes.</p>
-<p>ブレースの代わりに、クォートの代わりの演算子はどのような文字でも区切りとして使えます。ちょうど<code>m//</code>正規表現のマッチや<code>s///</code>正規表現の置換と同様です。これは、正規表現が多くのスラッシュやバックスラッシュを含む場合に、非常に有用です。例えば、<code>m!///!</code>は、全貌の3文字のスラッシュにマッチします。</p>
-<p class="original">Perl does have <code>CONSTANTS</code>. These are discouraged now, but weren't always. Constants are actually just subroutine calls with omitted brackets.</p>
-<p>Perlには<code>定数</code>があります。 気落ちするようなものですが、常にではありません。定数は実際には、ブラケットを省略したただのサブルーチン呼び出しです。</p>
-<p class="original">Sometimes people omit quotes around hash keys. They can get away with it because in this situation a bareword (a string with no sigil) occurs as a string, as opposed to a subroutine call or a filehandle or a package name.</p>
-<p>時々、ハッシュのキーでクォートを省略されていますが、この状況では、裸のワード(シジルのない文字列)は、サブルーチン呼び出しやファイルハンドルやパッケージ名ではなく、文字列になるからです。</p>
-<p class="original">If you see a block of unformatted code wrapped in a delimiter with double chevrons, like <code>&lt;&lt;EOF</code>, the magic word to Google for is "heredoc".</p>
-<p><code>&lt;&lt;EOF</code>のように、2つの山括弧で区切られてラップされた整理されていないコードのブロックを見たら、Google検索のためのマジックワードは"ヒアドキュメント"です。</p>
-<p class="original">The Data::Dumper module can be used to output an arbitrary scalar variable to the screen. This is an essential debug tool.</p>
-<p>Data::Dumperモジュールは任意のスカラの値をスクリーンに出力するのに使えます。これは基本的なデバッグツールです。</p>
-<p class="original">Warning! Many built-in functions can be called with no arguments, <strong>causing them to operate on <code>$_</code> instead</strong>. Hopefully this will help you understand formations like:</p>
-<p>注意! 多くの組込関数では、引数なしで呼ぶと<strong><code>$_</code>が代わりに渡されます</strong>。願わくば、次のような形を理解する助けになれば良いのですが:</p>
+<p class="original">and</p>
+<p>そして</p>
 <pre class="perl prettyprint">
-print foreach @array;
-
 foreach ( @array ) {
 	next unless defined;
 }
 </pre>
-<p class="original">I dislike this formation because it can lead to problems when refactoring.</p>
-<p>私は、この形は嫌いです。リファクタリングの際に、問題を起こすことがあるからです。</p>
+		<p class="original">I dislike this formation because it can lead to problems when refactoring.</p>
+                <p>私は、この形は嫌いです。リファクタリングの際に、問題を起こすことがあるからです。</p>
+	</li>
+</ul>
 
 <p class="original">The end.</p>
 <p>おしまい。</p>



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